ES 9.1.3, geonames datasets, index name is “field-name-index-phrase-geonames”
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size dataset.size
green open field-name-index-phrase-geonames wWbyhMZwQeOeyV2Lvjy8Ng 3 0 11396503 0 2.5gb 2.5gb 2.5gb
curl -XGET "http://localhost:9200/field-name-index-phrase-geonames/_search" -H 'Content-Type: application/json' -d'
{
"size": 2,
"track_total_hits": true,
"profile": true,
"query": {
"match_phrase": {
"name": "hall of jehovahs"
}
}
}'
field “name” mappings like:
{
"field-name-index-phrase-geonames" : {
"mappings" : {
"name" : {
"full_name" : "name",
"mapping" : {
"name" : {
"type" : "text",
"fields" : {
"raw" : {
"type" : "text",
"analyzer" : "standard"
}
},
"analyzer" : "standard",
"index_phrases" : true
}
}
}
}
}
}
default match_phrase result is:
{"took":1,"timed_out":false,"_shards":{"total":3,"successful":3,"skipped":0,"failed":0},"hits":{"total":{"value":1033,"relation":"eq"},"max_score":12.395212,"hits":[{"_index":"field-name-index-phrase-geonames","_id":"ktLihJkB4j3NtqEkX57g","_score":12.395212,"_source":{"geonameid": 5280410, "name": "Kingdom Hall of Jehovahs Witnesses", "asciiname": "Kingdom Hall of Jehovahs Witnesses", "feature_class": "S", "feature_code": "CH", "country_code": "US", "admin1_code": "WV", "admin2_code": "029", "population": 0, "elevation": 237, "dem": "235", "timezone": "America/New_York", "location": [-80.58424, 40.40618]}},{"_index":"field-name-index-phrase-geonames","_id":"fB7ihJkB4j3NtqEkr2r8","_score":12.395212,"_source":{"geonameid": 6335206, "name": "Kingdom Hall of Jehovahs Witnesses", "asciiname": "Kingdom Hall of Jehovahs Witnesses", "feature_class": "S", "feature_code": "CH", "country_code": "US", "admin1_code": "NY", "admin2_code": "071", "population": 0, "elevation": 80, "dem": "85", "timezone": "America/New_York", "location": [-74.03778, 41.50917]}}]},"profile":{"shards":[{"id":"[eMTQVBxNRHSgXOlKr-wicw][field-name-index-phrase-geonames][0]","node_id":"eMTQVBxNRHSgXOlKr-wicw","shard_id":0,"index":"field-name-index-phrase-geonames","cluster":"(local)","searches":[{"query":[{"type":"PhraseQuery","description":"name:"hall of jehovahs"","time_in_nanos":417096,"breakdown":{"set_min_competitive_score_count":0,"match_count":344,"shallow_advance_count":0,"set_min_competitive_score":0,"next_doc":78771,"match":74665,"next_doc_count":351,"score_count":344,"compute_max_score_count":0,"compute_max_score":0,"advance":0,"advance_count":0,"count_weight_count":0,"score":32903,"build_scorer_count":17,"create_weight":174833,"shallow_advance":0,"count_weight":0,"create_weight_count":1,"build_scorer":55924}}],"rewrite_time":380,"collector":[{"name":"QueryPhaseCollector","reason":"search_query_phase","time_in_nanos":105830,"children":[{"name":"TopScoreDocCollector","reason":"search_top_hits","time_in_nanos":57244}]}]}],"aggregations":,"fetch":{"type":"fetch","description":"","time_in_nanos":132598,"breakdown":{"load_stored_fields":67353,"load_source":200,"load_stored_fields_count":2,"next_reader_count":1,"load_source_count":2,"next_reader":11009},"debug":{"stored_fields":["_id","_routing","_source"]},"children":[{"type":"FetchFieldsPhase","description":"","time_in_nanos":6910,"breakdown":{"process_count":2,"process":2380,"next_reader":4530,"next_reader_count":1}},{"type":"FetchSourcePhase","description":"","time_in_nanos":1490,"breakdown":{"process_count":2,"process":1340,"next_reader":150,"next_reader_count":1},"debug":{"fast_path":2}},{"type":"StoredFieldsPhase","description":"","time_in_nanos":860,"breakdown":{"process_count":2,"process":560,"next_reader":300,"next_reader_count":1}}]}},{"id":"[eMTQVBxNRHSgXOlKr-wicw][field-name-index-phrase-geonames][1]","node_id":"eMTQVBxNRHSgXOlKr-wicw","shard_id":1,"index":"field-name-index-phrase-geonames","cluster":"(local)","searches":[{"query":[{"type":"PhraseQuery","description":"name:"hall of jehovahs"","time_in_nanos":411676,"breakdown":{"set_min_competitive_score_count":0,"match_count":332,"shallow_advance_count":0,"set_min_competitive_score":0,"next_doc":76771,"match":75058,"next_doc_count":340,"score_count":332,"compute_max_score_count":0,"compute_max_score":0,"advance":0,"advance_count":0,"count_weight_count":0,"score":33976,"build_scorer_count":18,"create_weight":172104,"shallow_advance":0,"count_weight":0,"create_weight_count":1,"build_scorer":53767}}],"rewrite_time":260,"collector":[{"name":"QueryPhaseCollector","reason":"search_query_phase","time_in_nanos":102478,"children":[{"name":"TopScoreDocCollector","reason":"search_top_hits","time_in_nanos":57698}]}]}],"aggregations":},{"id":"[eMTQVBxNRHSgXOlKr-wicw][field-name-index-phrase-geonames][2]","node_id":"eMTQVBxNRHSgXOlKr-wicw","shard_id":2,"index":"field-name-index-phrase-geonames","cluster":"(local)","searches":[{"query":[{"type":"PhraseQuery","description":"name:"hall of jehovahs"","time_in_nanos":455203,"breakdown":{"set_min_competitive_score_count":0,"match_count":357,"shallow_advance_count":0,"set_min_competitive_score":0,"next_doc":82796,"match":79459,"next_doc_count":365,"score_count":357,"compute_max_score_count":0,"compute_max_score":0,"advance":0,"advance_count":0,"count_weight_count":0,"score":38152,"build_scorer_count":18,"create_weight":187043,"shallow_advance":0,"count_weight":0,"create_weight_count":1,"build_scorer":67753}}],"rewrite_time":390,"collector":[{"name":"QueryPhaseCollector","reason":"search_query_phase","time_in_nanos":100972,"children":[{"name":"TopScoreDocCollector","reason":"search_top_hits","time_in_nanos":64891}]}]}],"aggregations":}]}}
using shingles result is:
{"took":1,"timed_out":false,"_shards":{"total":3,"successful":3,"skipped":0,"failed":0},"hits":{"total":{"value":1033,"relation":"eq"},"max_score":11.053446,"hits":[{"_index":"field-name-index-phrase-geonames","_id":"Ev3ihJkB4j3NtqEklEKY","_score":11.053446,"_source":{"geonameid": 4242282, "name": "Kingdom Hall of Jehovahs Witnesses", "asciiname": "Kingdom Hall of Jehovahs Witnesses", "feature_class": "S", "feature_code": "CH", "country_code": "US", "admin1_code": "IL", "admin2_code": "083", "population": 0, "elevation": 192, "dem": "194", "timezone": "America/Chicago", "location": [-90.31317, 39.12171]}},{"_index":"field-name-index-phrase-geonames","_id":"Ff3ihJkB4j3NtqEklEKY","_score":11.053446,"_source":{"geonameid": 4242285, "name": "Kingdom Hall of Jehovahs Witnesses", "asciiname": "Kingdom Hall of Jehovahs Witnesses", "feature_class": "S", "feature_code": "CH", "country_code": "US", "admin1_code": "IL", "admin2_code": "193", "population": 0, "elevation": 114, "dem": "116", "timezone": "America/Chicago", "location": [-88.15504, 38.09532]}}]},"profile":{"shards":[{"id":"[eMTQVBxNRHSgXOlKr-wicw][field-name-index-phrase-geonames][0]","node_id":"eMTQVBxNRHSgXOlKr-wicw","shard_id":0,"index":"field-name-index-phrase-geonames","cluster":"(local)","searches":[{"query":[{"type":"PhraseQuery","description":"name._index_phrase:"hall of of jehovahs"","time_in_nanos":294823,"breakdown":{"set_min_competitive_score_count":0,"match_count":344,"shallow_advance_count":0,"set_min_competitive_score":0,"next_doc":24948,"match":30745,"next_doc_count":351,"score_count":344,"compute_max_score_count":0,"compute_max_score":0,"advance":0,"advance_count":0,"count_weight_count":0,"score":36979,"build_scorer_count":17,"create_weight":148355,"shallow_advance":0,"count_weight":0,"create_weight_count":1,"build_scorer":53796}}],"rewrite_time":370,"collector":[{"name":"QueryPhaseCollector","reason":"search_query_phase","time_in_nanos":89737,"children":[{"name":"TopScoreDocCollector","reason":"search_top_hits","time_in_nanos":62347}]}]}],"aggregations":},{"id":"[eMTQVBxNRHSgXOlKr-wicw][field-name-index-phrase-geonames][1]","node_id":"eMTQVBxNRHSgXOlKr-wicw","shard_id":1,"index":"field-name-index-phrase-geonames","cluster":"(local)","searches":[{"query":[{"type":"PhraseQuery","description":"name._index_phrase:"hall of of jehovahs"","time_in_nanos":293878,"breakdown":{"set_min_competitive_score_count":0,"match_count":332,"shallow_advance_count":0,"set_min_competitive_score":0,"next_doc":24471,"match":27812,"next_doc_count":340,"score_count":332,"compute_max_score_count":0,"compute_max_score":0,"advance":0,"advance_count":0,"count_weight_count":0,"score":40775,"build_scorer_count":18,"create_weight":148365,"shallow_advance":0,"count_weight":0,"create_weight_count":1,"build_scorer":52455}}],"rewrite_time":370,"collector":[{"name":"QueryPhaseCollector","reason":"search_query_phase","time_in_nanos":91835,"children":[{"name":"TopScoreDocCollector","reason":"search_top_hits","time_in_nanos":65133}]}]}],"aggregations":,"fetch":{"type":"fetch","description":"","time_in_nanos":124388,"breakdown":{"load_stored_fields":62664,"load_source":360,"load_stored_fields_count":2,"next_reader_count":1,"load_source_count":2,"next_reader":11439},"debug":{"stored_fields":["_id","_routing","_source"]},"children":[{"type":"FetchFieldsPhase","description":"","time_in_nanos":7279,"breakdown":{"process_count":2,"process":2470,"next_reader":4809,"next_reader_count":1}},{"type":"FetchSourcePhase","description":"","time_in_nanos":1410,"breakdown":{"process_count":2,"process":1250,"next_reader":160,"next_reader_count":1},"debug":{"fast_path":2}},{"type":"StoredFieldsPhase","description":"","time_in_nanos":758,"breakdown":{"process_count":2,"process":449,"next_reader":309,"next_reader_count":1}}]}},{"id":"[eMTQVBxNRHSgXOlKr-wicw][field-name-index-phrase-geonames][2]","node_id":"eMTQVBxNRHSgXOlKr-wicw","shard_id":2,"index":"field-name-index-phrase-geonames","cluster":"(local)","searches":[{"query":[{"type":"PhraseQuery","description":"name._index_phrase:"hall of of jehovahs"","time_in_nanos":289595,"breakdown":{"set_min_competitive_score_count":0,"match_count":357,"shallow_advance_count":0,"set_min_competitive_score":0,"next_doc":25457,"match":31289,"next_doc_count":365,"score_count":357,"compute_max_score_count":0,"compute_max_score":0,"advance":0,"advance_count":0,"count_weight_count":0,"score":35752,"build_scorer_count":18,"create_weight":146026,"shallow_advance":0,"count_weight":0,"create_weight_count":1,"build_scorer":51071}}],"rewrite_time":610,"collector":[{"name":"QueryPhaseCollector","reason":"search_query_phase","time_in_nanos":90108,"children":[{"name":"TopScoreDocCollector","reason":"search_top_hits","time_in_nanos":61974}]}]}],"aggregations":}]}}
Comparing the two query modes, the hits.total is the same, but the single hits result sets are different. If the same query is changed to the shingles method, the hits results are different, which is considered a problem. What do you think about this problem? Thanks for your answer.