MATCH 22

2-2-3. Multiword Queries

If we could search for only one word at a time, full-text search would be pretty inflexible. Fortunately, the match query makes multiword queries just as simple:한번에 한 단어만을 검색할 수 있다면, full-text 검색은 아주 융통성 없는 검색일 것이다. 하지만, matchquery는 간단하게 여러 단어로 된 query를 만들 수 있다.GET /my_index/my_type/_search { "query": { "match": { "title": "BROWN DOG!" } } }COPY AS CURLVIEW IN SENSE The preceding query returns a..

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-2-7. Controlling Analysis

Queries can find only terms that actually exist in the inverted index, so it is important to ensure that the same analysis process is applied both to the document at index time, and to the query string at search time so that the terms in the query match the terms in the inverted index.query는 inverted index에 실제로 존재하는 단어만을 찾을 수 있다. 따라서 document를 index할할 때 적용되는 프로세스와, 검색 시 query string에 적용되는 프로세스가,..

2-2-8. Relevance Is Broken!

Before we move on to discussing more-complex queries in Multifield Search, let’s make a quick detour to explain why we created our test index with just one primary shard.Multifield Search에서, 더 복잡한 query에 대해 알아보기 전에, 하나의 primary shard만을 가진 test index를 생성한 이유를 설명하겠다.Every now and again a new user opens an issue claiming that sorting by relevance is broken and offering a short reproduction: the use..

2-3. Multifield Search

Queries are seldom simple one-clause match queries. We frequently need to search for the same or different query strings in one or more fields, which means that we need to be able to combine multiple query clauses and their relevance scores in a way that makes sense.query는 단순하게 match query 하나의 절로 이루어 지지는 않는다. 하나 이상의 field에 동일하거나 혹은 다른 query string으로 검색하는 경우가 자주 발생한다. 즉, 다중 query 절과 relevance sco..

2-4. Proximity Matching

Standard full-text search with TF/IDF treats documents, or at least each field within a document, as a big bag of words. The match query can tell us whether that bag contains our search terms, but that is only part of the story. It can’t tell us anything about the relationship between words.TF/IDF를 가진 표준 full-text 검색은, document나, 최소한 document내의 각각의 filed를, 단어가 들어 있는 큰 가방(bag of words) 으로 생각한다. 그..

2-4-1. Phrase Matching

In the same way that the match query is the go-to query for standard full-text search, the match_phrase query is the one you should reach for when you want to find words that are near each other:표준 full-text 검색에 대해, match query가 정보를 찾는 query인 것과 동일한 방식으로, match_phrasequery는 서로 가까이 있는 단어들을 찾는 경우에 사용할 query 중 하나이다.GET /my_index/my_type/_search { "query": { "match_phrase": { "title": "quick brown f..

2-4-6. Improving Performance

Phrase and proximity queries are more expensive than simple match queries. Whereas a matchquery just has to look up terms in the inverted index, a match_phrase query has to calculate and compare the positions of multiple possibly repeated terms.phrase와 proximity query는, 단순한 match query에 비해, 더 많은 비용이 든다. match query는 단어를 inverted index에서 찾는 반면에, match_phrase query는 가능한 한 여러 번, 반복해서 단어들의 위치를 계산하고 ..