From 058db6b945c9d507057359fe80a2472351b66561 Mon Sep 17 00:00:00 2001 From: liugq Date: Mon, 4 Jul 2022 15:42:21 +0800 Subject: [PATCH] update mapping for channel --- model/alerting/destination.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/model/alerting/destination.go b/model/alerting/destination.go index 1fec2bbd..d0bcc9d2 100644 --- a/model/alerting/destination.go +++ b/model/alerting/destination.go @@ -8,12 +8,11 @@ import "infini.sh/framework/core/orm" type Channel struct { orm.ORMObjectBase - Name string `json:"name"` - Type string `json:"type"` // email or webhook + Name string `json:"name" elastic_mapping:"name:{type:keyword,copy_to:search_text}"` + Type string `json:"type" elastic_mapping:"name:{type:keyword,copy_to:search_text}"` // email or webhook Priority int `json:"priority,omitempty"` Webhook *CustomWebhook `json:"webhook,omitempty"` - //Name string `json:"name" elastic_mapping:"name:{type:keyword,copy_to:search_text}"` - //SearchText string `json:"-" elastic_mapping:"search_text:{type:text,index_prefixes:{},index_phrases:true, analyzer:suggest_text_search }"` + SearchText string `json:"-" elastic_mapping:"search_text:{type:text,index_prefixes:{},index_phrases:true, analyzer:suggest_text_search }"` }