ElasticSearch


ElasticSearch

GET products/_search { "query": { "bool": { "must": [ { "match": { "name": "laptop" } }, { "range": { "price": { "gte": 500, "lte": 2000 } } } ], "must_not": [ { "term": { "discounted": true } } ], "should": [ { "term": { "brand.keyword": "Apple" } }, { "term": { "brand.keyword": "Samsung" } } ] } } } must 쿼리가 모두 참인 문서만 검색 AND 조건 must_not 쿼리가 모두 거짓인 문서만 검색 AND 조건 should 쿼리 중 하나만 만족하면 검색함 OR 조건 많은 쿼리가 만족할 수록 score 상승 filter 쿼리가 모두 참인 문서만 검색 AND 조건 must보다 속도가 빠르다. score를 산정하지 않는다. 캐시 가능...



원문링크 : ElasticSearch