Relevance 24

2. Search in Depth

In Getting Started we covered the basic tools in just enough detail to allow you to start searching your data with Elasticsearch. It won’t take long, though, before you find that you want more: more flexibility when matching user queries, more-accurate ranking of results, more-specific searches to cover different problem domains.Getting Started에서 Elasticsearch로 데이터 검색을 시작할 수 있는, 충분히 자세한 기본적인 too..

2-2. Full-Text Search

Now that we have covered the simple case of searching for structured data, it is time to explore full-text search: how to search within full-text fields in order to find the most relevant documents.지금까지 구조화된 데이터를 위한, 간단한 검색을 살펴봤다. 이제 full-text 검색(full-text search) 을 탐험할 시간이다. 가장 적합한 document를 찾기 위해, full-text field를 검색하는 방법을 알아 보자.The two most important aspects of full-text search are as follows..

2-2-1. Term-Based Versus Full-Text

While all queries perform some sort of relevance calculation, not all queries have an analysis phase.Besides specialized queries like the bool or function_score queries, which don’t operate on text at all, textual queries can be broken down into two families:모든 query가 relevance 연산의 일종을 수행하지만, 모든 query가 analysis 절을 가지지는 않는다. 텍스트를 전혀 다루지 않는, bool 이나 function-score query 같은 특별한 query 이외에, 텍스트를 다루는 ..

2-2-2. The match Query

The match query is the go-to query—the first query that you should reach for whenever you need to query any field. It is a high-level full-text query, meaning that it knows how to deal with both full-text fields and exact-value fields.match query는 어떤 field를 query할 때마다 만나야 하는 첫 번째 query이다. match query는, full-text field와 exact-value field 양쪽 모두를 처리하는 방법을 알고 있는, high-level full-text query 이다.That s..

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-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-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-5-2. prefix Query

To find all postcodes beginning with W1, we could use a simple prefix query:W1 로 시작하는 우편번호를 검색하기 위해, 간단한 prefix query를 사용할 수 있다.GET /my_index/address/_search { "query": { "prefix": { "postcode": "W1" } } }COPY AS CURLVIEW IN SENSE The prefix query is a low-level query that works at the term level. It doesn’t analyze the query string before searching. It assumes that you have passed it the exact ..