2つの異なるフィールド(緯度と経度)の組み合わせでデータをグループ化するElasticSearchクエリを実行したい
curl -XGET http://www.my_server:9200/idx_occurrence/Occurrence/_search?pretty=true -d '{
"query": {
"query_string" : {
"fields" : ["genus_interpreted","dataset"],
"query": "Pica 2",
"default_operator" : "AND"
}
},
"facets": {
"test": {
"terms": {
"fields" :["decimalLatitude","decimalLongitude"],
"size" : 500000000
}
}
}
}'
予想の2倍の結果が得られます...何か考えはありますか?
答えのより関連性の高い部分は...
_shards":{
"total":5,
"successful":5,
"failed":0
},
"hits":{
"total":**37**,
"max_score":3.9314494,
"hits":[{
合計ヒット数37は、ファセットを適用しない場合のクエリの結果です。この合計は、ファセットの合計の半分です(以下を参照)
"facets":{
"test":{
"_type":"terms",
"missing":0,
"total":**74**,
"other":0,
"terms":[
{"term":"167.21665954589844","count":5},
{"term":"167.25","count":4},
{"term":"167.14999389648438","count":4},
{"term":"167.1041717529297","count":4},
{"term":"-21.04166603088379","count":4},.....
したがって、ファセットのグループ化は個別に行われます(緯度と経度の順に)。
複数のレコードが緯度(ただし経度が異なる)またはその逆を共有できるため、緯度または経度だけでグループ化することはできないことに注意してください。