ElasticSearch Query DSLのクエリコンテキストとフィルタコンテキストとちょっと混乱します。私は以下の2つのクエリを持っています。どちらのクエリも同じ結果を返します。最初の評価スコアと2番目のスコアは一致しません。どちらが適切ですか?弾性検索クエリコンテキストとフィルタコンテキスト
第一クエリ: -
curl -XGET 'localhost:9200/xxx/yyy/_search?pretty' -d'
{
"query": {
"bool": {
"must": {
"terms": { "mcc" : ["5045","5499"]}
},
"must_not":{
"term":{"maximum_flag":false}
},
"filter": {
"geo_distance": {
"distance": "500",
"location": "40.959334, 29.082142"
}
}
}
}
}'
第二問合せ: -
curl -XGET 'localhost:9200/xxx/yyy/_search?pretty' -d'
{
"query": {
"bool" : {
"filter": [
{"term":{"maximum_flag":true}},
{"terms": { "mcc" : ["5045","5499"]}}
],
"filter": {
"geo_distance": {
"distance": "500",
"location": "40.959334, 29.082142"
}
}
}
}
}'
おかげで、あなたは良い説明を持っている公式ガイドで
この[SO](http://stackoverflow.com/questions/14595988/queries-vs-filters)は役に立ちます。 – Kulasangar