2.X/2. Search in Depth 62

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-1. Structured Search

Structured search is about interrogating data that has inherent structure. Dates, times, and numbers are all structured: they have a precise format that you can perform logical operations on. Common operations include comparing ranges of numbers or dates, or determining which of two values is larger.구조화(structured)된 검색 은 고유의 구조를 가진 데이터를 가져오는 것이다. date, time, number는 모두 구조화되어 있다. 이들은 논리적인 연산을 수행할..

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-1-4. Ranges

When dealing with numbers in this chapter, we have so far searched for only exact numbers. In practice, filtering on ranges is often more useful. For example, you might want to find all products with a price greater than $20 and less than $40.이 장에서 number를 다룰 때, 지금까지는 정확한 수만을 검색했었다. 실제로는, 범위를 filtering하는 것이 때때로 더 유용하다. 예를 들어, 가격이 $20보다 크고 $40보다 작은 모든 상품을 찾아보자.In SQL terms, a range can be express..

2-1-5. Dealing with Null Values

Think back to our earlier example, where documents have a field named tags. This is a multivalue field. A document may have one tag, many tags, or potentially no tags at all. If a field has no values, how is it stored in an inverted index?tags 라 이름 붙여진 field를 가진 document가 있는, 초기 예제를 다시 생각해 보자. 이 field는 다중 값 field이다. document는 하나의 태그 또는 다수의 태그를 가질 수도 있고, 어쩌면 전혀 없을 수도 있다. 만약 field가 아무런 값도 가지지 않는다면..

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 이외에, 텍스트를 다루는 ..