【发布时间】:2016-10-14 17:27:48
【问题描述】:
我想在多个字段中使用 yii2-elasticsearch 进行全文搜索,其中所有字段都使用分配的分析器在文档中进行检查。
所以如果我有一个映射:
"settings": {
"analysis": {
"analyzer": {
"lowercase_keyword": {
"tokenizer": "keyword",
"filter": [ "lowercase"]
}
}
}
},
"mappings" : {
"typeName" :{
"properties" : {
"id" : {
"type" : "string",
"index" : "not_analyzed"
},
"company_name" : {
"type" : "string",
"index" : "analyzed",
"analyzer" : "lowercase_keyword",
},
"product_name" : {
"type" : "string",
"index" : "analyzed",
"analyzer" : "lowercase_keyword",
},
"product_desc" : {
"type" : "string",
"index" : "not_analyzed"
},
}
}
}
}
我想在 company_name,product_name,product_desc 中搜索一个词。
【问题讨论】:
标签: php search elasticsearch yii2 full-text-search