2.X/1. Getting Started 93

1-05-4. Search Lite

There are two forms of the search API: a "lite" query-string version that expects all its parameters to be passed in the query string, and the full request body version that expects a JSON request body and uses a rich search language called the query DSL.search API에는 두 가지 형식이 있다. 하나는 query-string 의 "아류(lite)" 버전이다. 이 버전은 모든 매개변수가 query string에 전달된다. 다른 하나는 full request body 버전이다. 이 버전은 JSON requ..

1-06. Mapping and Analysis

While playing around with the data in our index, we notice something odd. Something seems to be broken: we have 12 tweets in our indices, and only one of them contains the date 2014-09-15, but have a look at the total hits for the following queries:index에 있는 데이터를 살펴보다 보면, 이상한 점을 발견할 수 있다. 뭔가 깨진 것 같다. index에는 12개의 tweet이 있다. 그 중의 단 하나만 2014-09-15 를 포함하고 있다. 그런데 아래 query의 total hits를 보면GET /_searc..

1-06-1. Exact Values Versus Full Text

Data in Elasticsearch can be broadly divided into two types: exact values and full text.Elasticsearch에서 데이터는 크게 두 가지(exact value와 full text) 형태로 나누어진다.Exact values are exactly what they sound like. Examples are a date or a user ID, but can also include exact strings such as a username or an email address. The exact value Foo is not the same as the exact value foo. The exact value 2014 is not the..

1-06-2. Inverted Index

Elasticsearch uses a structure called an inverted index, which is designed to allow very fast full-text searches. An inverted index consists of a list of all the unique words that appear in any document, and for each word, a list of the documents in which it appears.Elasticsearch는 full-text 검색을 매우 빠르게 할 수 있도록 설계된, inverted index 라는 구조를 사용한다. inverted index는 특정 document에 나타나는 유일한 단어 모두의 목록과, 각각의 ..

1-06-3. Analysis and Analyzers

Analysis is a process that consists of the following:analysis 프로세스는 다음과 같이 구성된다.First, tokenizing a block of text into individual terms suitable for use in an inverted index,먼저, 문장(text)을, inverted index에서 사용하기에 적합한, 개별 단어(term) 로 분리한다.Then normalizing these terms into a standard form to improve their "searchability" or recall그리고, "검색 능력", recall 을 개선하기 위해, 표준 형태로 이들 단어를 정규화한다.This job is perfor..

1-06-4. Mapping

In order to be able to treat date fields as dates, numeric fields as numbers, and string fields as full-text or exact-value strings, Elasticsearch needs to know what type of data each field contains. This information is contained in the mapping.date field를 날짜로, 숫자 field를 숫자로, string field를 full-text나 exact-value 문자열로 처리하기 위해서는, Elasticsearch는 각 field가 가지고 있는 데이터의 type을 알아야 한다. 이 정보는 mapping에 있다...

1-06-5. Complex Core Field Types

Besides the simple scalar datatypes that we have mentioned, JSON also has null values, arrays, and objects, all of which are supported by Elasticsearch.위에서 언급한 기본 데이터 type외에도, JSON은 null 값, 배열, 오브젝트도 가질 수 있다. Elasticsearch는 이들 모두를 지원한다.Multivalue FieldseditIt is quite possible that we want our tag field to contain more than one tag. Instead of a single string, we could index an array of tags:tag..

1-07. Full-Body Search

Search lite—a query-string search—is useful for ad hoc queries from the command line. To harness the full power of search, however, you should use the request body search API, so called because most parameters are passed in the HTTP request body instead of in the query string.가벼운(lite) 검색(query-string search)은 command line에서 직접 query를 실행하는데 유용하다. 그러나, 검색의 모든 기능을 이용하기 위해서는, request body search AP..

1-07-1. Empty Search

Let’s start with the simplest form of the search API, the empty search, which returns all documents in all indices:search API의 가장 간단한 형태인, empty search로 시작해 보자. 모든 indices의 모든 document를 반환한다.GET /_search {} COPY AS CURLVIEW IN SENSE 이것이 empty request body이다.Just as with a query-string search, you can search on one, many, or _all indices, and one, many, or all types:query-string 검색과 마찬가지로, 하나 이상 ..

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가 사용하는 유연하고, 표현력 있는 검..