should 8

2016.05.31 - 번역 - Lost in Translation: Boolean Operations and Filters in the Bool Query ...

With 5.0 on the horizon, a number of query types deprecated in 2.x will be removed. Many of those are replaced by functionality of the bool query, so here’s a quick guide on how to move away from filtered queries; and, or, not queries; and a general look into how to parse boolean logic with the bool query.5.0 이 출시되면서, 2.x 에서 deprecate된 많은 query 유형이 제거된다. 그들 중 많은 부분이 bool query 기능으로 대체된다. 그래서, 여기..

Blog 2019.01.07

1-07-2. Query DSL

The query DSL is a flexible, expressive search language that Elasticsearch uses to expose most of the power of Lucene through a simple JSON interface. It is what you should be using to write your queries in production. It makes your queries more flexible, more precise, easier to read, and easier to debug.query DSL은 간단한 JSON interface를 이용해, Lucene을 100% 활용하기 위해, Elasticsearch가 사용하는 유연하고, 표현력 있는 검..

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 ..

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-2-4. Combining Queries

In Combining Filters we discussed how to use the bool filter to combine multiple filter clauses with and, or, and not logic. In query land, the bool query does a similar job but with one important difference.Combining Filters에서, 다수의 filter 절을 and, or, not 으로 조합하기 위해, bool filter를 사용하는 방법에 대해 이야기한 바 있다. query에서도, bool query는 비슷한 작용을 하지만, 한가지 중요한 차이점이 있다.Filters make a binary decision: should this..

2-3-5. How match Uses bool

By now, you have probably realized that multiword match queries simply wrap the generated termqueries in a bool query. With the default or operator, each term query is added as a should clause, so at least one clause must match. These two queries are equivalent:이제, 다중 단어 match query는, 생성된 term query를 단순히 bool query로 감싼 것이라는 것을 알게 되었을 것이다. 각 term query가, 기본인 or operator와 함께, should 절에 추가된다. 따라서, ..

2-3-6. Boosting Query Clauses

Of course, the bool query isn’t restricted to combining simple one-word match queries. It can combine any other query, including other bool queries. It is commonly used to fine-tune the relevance _score for each document by combining the scores from several distinct queries.물론, bool query는, 간단한 단일 단어(one-word) match query를 조합하는데 있어, 제한이 없다. 다른 bool query는 물론이고, 다른 어떤 query와도 조합할 수 있다. 여러 별개의 que..

2-4-5. Proximity for Relevance

Although proximity queries are useful, the fact that they require all terms to be present can make them overly strict. It’s the same issue that we discussed in Controlling Precision in Full-Text Search: if six out of seven terms match, a document is probably relevant enough to be worth showing to the user, but the match_phrase query would exclude it.proximity query가 유용하지만, 모든 단어가 존재해야 한다는 사실은, 너..