Query
Filter
- score를 계산하지 않음
- 상황에 따라 성능 향상 가능
예제
POST test/_bulk
{"index":{"_id":"1"}}
{"text":"aaa"}
{"index":{"_id":"2"}}
{"text":"aaa bbb "}
GET test/_search
{
"query": {
"match": {
"text": "aaa"
}
}
}
{
"took": 0,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 2,
"relation": "eq"
},
"max_score": 0.21110919,
"hits": [
{
"_index": "test",
"_type": "_doc",
"_id": "1",
"_score": 0.21110919,
"_source": {
"text": "aaa"
}
},
{
"_index": "test",
"_type": "_doc",
"_id": "2",
"_score": 0.160443,
"_source": {
"text": "aaa bbb "
}
}
]
}
}
GET test/_search
{
"query": {
"bool": {
"filter": [
{
"match": {
"text": "aaa"
}
}
]
}
}
}
{
"took": 0,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 2,
"relation": "eq"
},
"max_score": 0.0,
"hits": [
{
"_index": "test",
"_type": "_doc",
"_id": "1",
"_score": 0.0,
"_source": {
"text": "aaa"
}
},
{
"_index": "test",
"_type": "_doc",
"_id": "2",
"_score": 0.0,
"_source": {
"text": "aaa bbb "
}
}
]
}
}