- 过滤器不会计算相关度的得分,所以它们在计算上更快一些
- 过滤器可以被缓存到内存中,这使得在重复的搜索查询上,其要比相应的查询快出许多。
其实就是bool查询
POST /book/_search{"query": {"bool": {"must": [{"match_all": {}}],"filter": {"range": {"price": {"gte": 200,"lte": 1000}}}}}}GET /hotel_price_2021.09.26/_search/{"query": {"bool": {"must": [{"term": {"mapping_id": {"value": "29397"}}}, {"term": {"prov_code": {"value": "17"}}}] ,"filter": {"range": {"@timestamp": {"gte": "now/d","lte": "now+30d/d"}}}}},"size": 5}
GET hotel_price/_search{"query":{"bool" : {"must" : [{"term" : {"prov_code" : {"value" : "1"}}}],"filter" : [{"term" : {"hotel_id" : {"value" : "19188"}}}]}},"collapse": {"field": "hotel_id"}}
