增加了子文档查询后, 查询效率就会很差:
{"track_total_hits": true,"from":20,"size":10,"sort":[{"edittime":"desc"}],
"query":{ "bool": {"must": [
{"bool": {"must":[{"match_phrase":{ "comname":"餐饮"}}]}},
{"has_child": {"type": "lxfs","query": {"term": {"contacttype": 0}}}}
]}} }
一旦去掉子集has_child查询, 查询效率很快:
{"track_total_hits": true,"from":20,"size":10,"sort":[{"edittime":"desc"}],
"query":{ "bool": {"must": [
{"bool": {"must":[{"match_phrase":{ "comname":"餐饮"}}]}}
]}} }
{"track_total_hits": true,"from":20,"size":10,"sort":[{"edittime":"desc"}],
"query":{ "bool": {"must": [
{"bool": {"must":[{"match_phrase":{ "comname":"餐饮"}}]}},
{"has_child": {"type": "lxfs","query": {"term": {"contacttype": 0}}}}
]}} }
一旦去掉子集has_child查询, 查询效率很快:
{"track_total_hits": true,"from":20,"size":10,"sort":[{"edittime":"desc"}],
"query":{ "bool": {"must": [
{"bool": {"must":[{"match_phrase":{ "comname":"餐饮"}}]}}
]}} }
1 个回复
zcc_vv - 95
赞同来自: