"title": {
"search_analyzer": "ik_smart_ts_synonym",
"analyzer": "ik_max_word_ts_synonym",
"type": "text",
"index_options": "docs"
},
"title_en": {
"search_analyzer": "english",
"analyzer": "english",
"type": "text",
"index_options": "docs"
},
这是title_en的设置,查询语句是:
{
"query": {
"bool": {
"must": {
"multi_match": {
"query": "苹果",
"fields": [
"title",
"title_en",
"title_ko",
"keywords"
],
"type": "best_fields",
"operator": "OR",
"slop": 0,
"prefix_length": 0,
"max_expansions": 50,
"lenient": false,
"zero_terms_query": "NONE",
"boost": 1
}
},
"should": [
{
"match_phrase": {
"title": {
"query": "苹果",
"boost": 1.5,
"slop": 0
}
}
},
{
"match_phrase": {
"title_en": {
"query": "苹果",
"boost": 1.5,
"slop": 0
}
}
},
{
"match_phrase": {
"keywords": {
"query": "苹果",
"boost": 1.5,
"slop": 0
}
}
}
],
"filter": {
"bool": {
"must": [
{
"nested": {
"path": "price",
"query": {
"term": {
"price.sales_org_id": 1
}
}
}
}
]
}
}
}
},
"from": 0,
"size": 100
}
报错提示说
"root_cause": [
{
"type": "query_shard_exception",
"reason": "failed to create query: field:[title_en] was indexed without position data; cannot run PhraseQuery",
"index_uuid": "t8mSqt2VRTOxEXmmzrTfEw",
"index": "sayweee_im_2020-11-26"
}
4 个回复
JiangJibo - 喊我雷锋
赞同来自: CurryQin
CurryQin
赞同来自:
JiangJibo - 喊我雷锋
赞同来自:
laoyang360 - 《一本书讲透Elasticsearch》作者,Elastic认证工程师 [死磕Elasitcsearch]知识星球地址:http://t.cn/RmwM3N9;微信公众号:铭毅天下; 博客:https://elastic.blog.csdn.net
赞同来自: