MATCH 22

1-01-08. Search with Query DSL

Query-string search is handy for ad hoc searches from the command line, but it has its limitations (see Search Lite). Elasticsearch provides a rich, flexible, query language called the query DSL, whichallows us to build much more complicated, robust queries.query-string 검색은 command line에서 바로(ad hoc) 검색하기에 편리하다. 하지만 한계가 있다(Search Lite 참조). Elasticsearch는 풍부하고, 유연한, query DSL 이라는 query language를 제..

1-01-09. More-Complicated Searches

Let’s make the search a little more complicated. We still want to find all employees with a last name of Smith, but we want only employees who are older than 30. Our query will change a little to accommodate a filter, which allows us to execute structured searches efficiently:약간 더 복잡한 검색을 해 보자. last name이 Smith인 모든 직원을 찾으면서, 나이가 30보다 많은 직원을 찾으려 한다. query는 구조화된 검색을 효율적으로 실행할 수 있는 filter 를 넣기 위해, ..

1-01-10. Full-Text Search

The searches so far have been simple: single names, filtered by age. Let’s try a more advanced, full-text search—a task that traditional databases would really struggle with.지금까지의 검색은 이름 하나만을 검색하고, 나이를 filtering하는 단순한 검색이었다. 기존의 DB와 진정으로 겨뤄볼 수 있는, 더 고급스러운 full-text 검색을 해 보자.We are going to search for all employees who enjoy rock climbing:rock climbing을 즐겨 하는 모든 직원을 찾아보자.GET /megacorp/employee/_s..

1-01-11. Phrase Search

Finding individual words in a field is all well and good, but sometimes you want to match exact sequences of words or phrases. For instance, we could perform a query that will match only employee records that contain both "rock" and "climbing" and that display the words next to each other in the phrase "rock climbing".특정 field에서 개별적인 단어를 찾는 것은 잘 된다. 하지만 가끔씩 정확한 순서의 단어들이나 구(句, phrases) 로 일치하기를 원한..

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-4. Most Important Queries

While Elasticsearch comes with many queries, you will use just a few frequently. We discuss them in much greater detail in Search in Depth but next we give you a quick introduction to the most important queries.Elasticsearch에는 많은 query가 있지만, 자주 사용하는 것은 소수일 것이다. Search in Depth에서, 훨씬 더 자세히 이야기할 것이다. 아래에서 가장 중요한 query들에 대해 빠르게 소개하겠다.match_all QueryeditThe match_all query simply matches all documen..

1-10-09. Customizing Dynamic Mapping

If you know that you are going to be adding new fields on the fly, you probably want to leave dynamic mapping enabled. At times, though, the dynamic mapping "rules" can be a bit blunt. Fortunately, there are settings that you can use to customize these rules to better suit your data.새로운 field를 추가하려는 것을, 지금 알고 있다면, dynamic mapping을 비활성화하고 싶을 것이다. 때때로, 동적 mapping "규칙" 은 조금 무딜 수 있다. 다행히도, 데이터에 더 적합..

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