constant_score 7

1-07-5. Combining queries together

Real world search requests are never simple; they search multiple fields with various input text, and filter based on an array of criteria. To build sophisticated search, you will need a way to combine multiple queries together into a single search request.현실에서 검색 request는 결코 간단하지 않다. 다양한 입력 문자열과 여러 조건의 배열을 기반으로 한 filter를 가지고 다수의 field를 검색한다. 정교한 검색을 위해, 하나의 검색 request에 다수의 query를 함께 조합해야 한다.To ..

1-08-1. Sorting

In order to sort by relevance, we need to represent relevance as a value. In Elasticsearch, the relevance score is represented by the floating-point number returned in the search results as the _score, so the default sort order is _score descending.relevance로 정렬하기 위해, relevance를 값으로 표시해야 한다. Elasticsearch에서 relevance score 는 _score 로, 검색 결과에 반환되는, 부동 소수점 숫자로 표시된다. 기본 정렬 순서는 _score 의 내림차순이다.Somet..

2-1-2. Combining Filters

The previous two examples showed a single filter in use. In practice, you will probably need to filter on multiple values or fields. For example, how would you express this SQL in Elasticsearch?앞의 두 가지 예제는 단일 filter의 사용을 보여준다. 실제 상황에서는, 아마도 여러 값 또는 field를 filtering해야 할 것이다. 예를 들면, 아래의 SQL을 Elasticsearch에서는 어떻게 표현할까?SELECT product FROM products WHERE (price = 20 OR productID = "XHDK-A-1293-#fJ3")..

2-1-3. Finding Multiple Exact Values

The term query is useful for finding a single value, but often you’ll want to search for multiple values.What if you want to find documents that have a price of $20 or $30?term query는 단일 값을 찾는데 유용하다. 그러나, 가끔은 다중 값을 찾을 수도 있다. 가격이 $20 또는 $30인 document를 찾으려면 어떻게 해야 할까?Rather than using multiple term queries, you can instead use a single terms query (note the s at the end). The terms query is simply..

2-6-04. Manipulating Relevance with Query Structure

The Elasticsearch query DSL is immensely flexible. You can move individual query clauses up and down the query hierarchy to make a clause more or less important. For instance, imagine the following query:Elasticsearch의 query DSL은 매우 유연하다. 개별 query 절을, 절의 중요도에 따라, query 계층 구조의 위아래로 옮길 수 있다. 예를 들어, 아래 query를 가정해 보자.quick OR brown OR red OR foxWe could write this as a bool query with all terms at t..

2-6-06. Ignoring TF/IDF

Sometimes we just don’t care about TF/IDF. All we want to know is that a certain word appears in a field. Perhaps we are searching for a vacation home and we want to find houses that have as many of these features as possible:TF/IDF에 관계없이, 어떤 field에 특정 단어가 나타나는지 알고 싶을 경우가 있다. 휴가용 별장을 검색하고 있고, 가능한 한 많은 기능(wifi, 정원, 풀장 등)을 가진 집을 찾고 있다면 말이다.WiFiGardenPoolThe vacation home documents look something l..