Get 7

1-01-06. Retrieving a Document

Now that we have some data stored in Elasticsearch, we can get to work on the business requirements for this application. The first requirement is the ability to retrieve individual employee data.이제 우리는 Elasticsearch에 저장되어 있는 약간의 데이터를 가지고, 이 응용프로그램의 요구사항에 대한 작업을 할 수 있다. 첫 번째 요구 사항은 직원 개인 데이터를 가져오는 기능이다.This is easy in Elasticsearch. We simply execute an HTTP GET request and specify the address o..

1-01-07. Search Lite

A GET is fairly simple—you get back the document that you ask for. Let’s try something a little more advanced, like a simple search!GET 은 상당히 간단하다. request하면 document를 받을 수 있다. 간단한 검색처럼, 약간 더 고급스러운 뭔가를 해 보자.The first search we will try is the simplest search possible. We will search for all employees, with this request:첫 번째 검색은 가능한 가장 단순한 검색이다. 아래의 request를 가지고, 모든 직원을 검색할 것이다.GET /megacorp/empl..

1-03-04. Retrieving a Document

To get the document out of Elasticsearch, we use the same _index, _type, and _id, but the HTTP verb changes to GET:Elasticsearch에서 document를 가져오기 위해서는, 동일한 _index, _type, _id 를 사용해야 한다. 그러나 HTTP verb는 GET 으로 바꾸어야 한다.GET /website/blog/123?prettyCOPY AS CURLVIEW IN SENSE The response includes the by-now-familiar metadata elements, plus the _source field, which contains the original JSON document t..

1-03-05. Checking Whether a Document Exists

If all you want to do is to check whether a document exists—you’re not interested in the content at all—then use the HEAD method instead of the GET method. HEAD requests don’t return a body, just HTTP headers:document의 내용에는 전혀 관심이 없고, document가 존재하는지 여부만을 알고 싶다면, GET 대신에 HEAD method를 사용한다. HEAD request는 body를 반환하지 않고, HTTP header만을 반환한다.curl -i -XHEAD http://localhost:9200/website/blog/123Elasti..

1-03-06. Updating a Whole Document

Documents in Elasticsearch are immutable; we cannot change them. Instead, if we need to update an existing document, we reindex or replace it, which we can do using the same index API that we have already discussed in Indexing a Document.Elasticsearch에서 document는 불변 이다. document를 변경할 수 없다. 대신, 기존의 document를 업데이트하려면, reindex 또는 replace해야 한다. Indexing a Document에서 이미 이야기했던 것과 동일한 index API를 사용할 수 ..

1-03-12. Retrieving Multiple Documents

As fast as Elasticsearch is, it can be faster still. Combining multiple requests into one avoids the network overhead of processing each request individually. If you know that you need to retrieve multiple documents from Elasticsearch, it is faster to retrieve them all in a single request by using the multi-get, or mget, API, instead of document by document.Elasticsearch가 빠른 만큼, 여전히 더 빨라질 수 있다. ..

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 검색과 마찬가지로, 하나 이상 ..