23
Elastic search 검색 cecil

Elastic search 검색

Embed Size (px)

Citation preview

Page 1: Elastic search 검색

Elastic����������� ������������������  search����������� ������������������  검색cecil

Page 2: Elastic search 검색

Contents

•일래스틱����������� ������������������  서치����������� ������������������  질의����������� ������������������  

•질의����������� ������������������  과정����������� ������������������  

•기본����������� ������������������  질의����������� ������������������  

•복합����������� ������������������  질의

Page 3: Elastic search 검색

질의����������� ������������������  방법•URI를����������� ������������������  사용한����������� ������������������  질의����������� ������������������  방법����������� ������������������  

•q����������� ������������������  매개����������� ������������������  변수에����������� ������������������  “필드명:질의어”를����������� ������������������  사용����������� ������������������  

•ex)����������� ������������������  curl����������� ������������������  -XGET����������� ������������������  'localhost:9200/library/book/_search?q=title:crime&pretty=true'����������� ������������������  

•request����������� ������������������  body를����������� ������������������  이용한����������� ������������������  방법����������� ������������������  

•ex)����������� ������������������  curl����������� ������������������  -XGET����������� ������������������  'localhost:9200/library/book/_search?pretty=true'����������� ������������������  -d����������� ������������������  '{����������� ������������������  ����������� ������������������  "query"����������� ������������������  :����������� ������������������  {����������� ������������������  "query_string"����������� ������������������  :{����������� ������������������  "query"����������� ������������������  :����������� ������������������  "title:crime"����������� ������������������  }����������� ������������������  ����������� ������������������  }}'����������� ������������������  

Page 4: Elastic search 검색

Request����������� ������������������  Body����������� ������������������  기본구조

{����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ..추가����������� ������������������  옵션..����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  "query":����������� ������������������  {����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  "<쿼리타입>":����������� ������������������  {����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  "<필드명>":����������� ������������������  {..����������� ������������������  질의문법..}����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  }����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  }����������� ������������������  }

Page 5: Elastic search 검색

기본����������� ������������������  추가����������� ������������������  옵션•페이징����������� ������������������  

•from:����������� ������������������  시작����������� ������������������  문서����������� ������������������  위치,����������� ������������������  기본����������� ������������������  값����������� ������������������  0����������� ������������������  

•size:����������� ������������������  질의����������� ������������������  결과로����������� ������������������  얻는����������� ������������������  최대����������� ������������������  문서의����������� ������������������  수,����������� ������������������  기본값����������� ������������������  10����������� ������������������  

•버전값����������� ������������������  반환����������� ������������������  

•version:����������� ������������������  반환하는����������� ������������������  도큐먼트의����������� ������������������  버전을����������� ������������������  포함����������� ������������������  

•점수����������� ������������������  제한����������� ������������������  

•min_score:����������� ������������������  문서의����������� ������������������  최소����������� ������������������  점수����������� ������������������  값을����������� ������������������  기준으로����������� ������������������  필터링

Page 6: Elastic search 검색

기본����������� ������������������  추가����������� ������������������  옵션(con’d)

•반환을����������� ������������������  원하는����������� ������������������  필드����������� ������������������  선택����������� ������������������  

• 와일드����������� ������������������  카드����������� ������������������  사용����������� ������������������  가능����������� ������������������  

• fields:����������� ������������������  원하는����������� ������������������  필드만����������� ������������������  선택하여����������� ������������������  반환����������� ������������������  

• partial_fields:����������� ������������������  include,����������� ������������������  exclude를����������� ������������������  사용����������� ������������������  가능

"partial_fields"����������� ������������������  :����������� ������������������  {����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  "partial1"����������� ������������������  :����������� ������������������  {����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  "include"����������� ������������������  :����������� ������������������  [����������� ������������������  "titl*"����������� ������������������  ],����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  "exclude"����������� ������������������  :����������� ������������������  [����������� ������������������  "chara*"����������� ������������������  ]����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  }����������� ������������������  }

"fields"����������� ������������������  :����������� ������������������  [����������� ������������������  "title",����������� ������������������  "year"����������� ������������������  ]

Page 7: Elastic search 검색

기본����������� ������������������  추가����������� ������������������  옵션(con’d)•스크립트����������� ������������������  필드����������� ������������������  

•문서����������� ������������������  반환을����������� ������������������  위해����������� ������������������  스크립트����������� ������������������  평가����������� ������������������  값을����������� ������������������  사용

����������� ������������������  {����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  "script_fields"����������� ������������������  :����������� ������������������  {����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  "correctYear"����������� ������������������  :����������� ������������������  {����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  "script"����������� ������������������  :����������� ������������������  "doc['year'].value����������� ������������������  -����������� ������������������  1800"����������� ������������������  }����������� ������������������  },����������� ������������������  ����������� ������������������  

����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  "query"����������� ������������������  :����������� ������������������  {����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  "query_string"����������� ������������������  :����������� ������������������  {����������� ������������������  "query"����������� ������������������  :����������� ������������������  "title:crime"����������� ������������������  }����������� ������������������  

}����������� ������������������  }����������� ������������������  

����������� ������������������  ����������� ������������������  {����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  "script_fields"����������� ������������������  :����������� ������������������  {����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  "correctYear"����������� ������������������  :����������� ������������������  {����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  "script"����������� ������������������  :����������� ������������������  "_source.year����������� ������������������  -����������� ������������������  1800"����������� ������������������  }����������� ������������������  },����������� ������������������  ����������� ������������������  

����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  "query"����������� ������������������  :����������� ������������������  {����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  "query_string"����������� ������������������  :����������� ������������������  {����������� ������������������  "query"����������� ������������������  :����������� ������������������  "title:crime"����������� ������������������  }����������� ������������������  }����������� ������������������  }����������� ������������������  ����������� ������������������  

빠르나����������� ������������������  메모리����������� ������������������  많이����������� ������������������  사용����������� ������������������  단일����������� ������������������  값����������� ������������������  제한이����������� ������������������  있음

느리긴����������� ������������������  하나����������� ������������������  메모리����������� ������������������  효율적����������� ������������������  복잡한����������� ������������������  필드����������� ������������������  사용����������� ������������������  가능

Page 8: Elastic search 검색

1.����������� ������������������  질의를����������� ������������������  노드����������� ������������������  한����������� ������������������  곳(2)����������� ������������������  으로����������� ������������������  전송����������� ������������������  

2.����������� ������������������  질의를����������� ������������������  받은����������� ������������������  노드는����������� ������������������  모든����������� ������������������  샤드로����������� ������������������  분산����������� ������������������  

3.����������� ������������������  각����������� ������������������  샤드는����������� ������������������  식별자와����������� ������������������  점수를����������� ������������������  (2)로����������� ������������������  반환����������� ������������������  

4.����������� ������������������  (2)는����������� ������������������  모든����������� ������������������  결과를����������� ������������������  기다렸다가����������� ������������������  취합����������� ������������������  

5.����������� ������������������  (2)는����������� ������������������  결과를����������� ������������������  만들기����������� ������������������  위해����������� ������������������  대상����������� ������������������  샤드에만����������� ������������������  요청

질의����������� ������������������  과정 Chapter 3

[ 103 ]

Query logicElasticsearch is a distributed search engine, and so all functionality provided must be distributed in its nature. It is exactly the same with querying. Since we want to discuss some more advanced topics on how to control the query process, we first need to know how it works.

By default, if we don't alter anything, the query process will consist of two phases as shown in the following diagram:

Application

Elasticsearch Node

Elasticsearch Node

Elasticsearch Cluster

Shard 1

Shard 2

Scatter phase

Gather phase

Results

Query

When we send a query, we send it to one of the Elasticsearch nodes. What is occurring now is a so-called scatter phase. The query is distributed to all the shards that our index is built of. For example, if it is built of five shards and one replica, then five physical shards will be queried (we don't need to query both a shard and its replica because they contain the same data). Each of the queried shards will only return the document identifier and the score of the document. The node that sent the scatter query will wait for all the shards to complete their task, gather the results, and sort them appropriately (in this case, from the top scoring to the lowest scoring ones).

After that, a new request will be sent to build the search results. However, for now, the request will be sent only to those shards that held the documents to build the response. In most cases, Elasticsearch won't send the request to all the shards but only to its subset. This is because we usually don't get the entire result of the query but only a portion of it. This phase is called the gather phase. After all the documents have been gathered, the final response is built and returned as the query result.

www.it-ebooks.info

Page 9: Elastic search 검색

검색����������� ������������������  타입

•요청����������� ������������������  매개����������� ������������������  변수로����������� ������������������  지정����������� ������������������  

• ex)����������� ������������������  curl����������� ������������������  -XGET����������� ������������������  'localhost:9200/library/book/_search?pretty=true&search_type=query_and_fetch'����������� ������������������  ����������� ������������������  

•query_then_fetch����������� ������������������  (default)����������� ������������������  

•전체����������� ������������������  샤드����������� ������������������  검색이����������� ������������������  완료된����������� ������������������  후����������� ������������������  결과����������� ������������������  출력����������� ������������������  

•요청����������� ������������������  size����������� ������������������  만큼����������� ������������������  반환����������� ������������������  

•query_and_fetch����������� ������������������  

•샤드별로����������� ������������������  검색이����������� ������������������  완료����������� ������������������  되는����������� ������������������  대로����������� ������������������  결과를����������� ������������������  출력����������� ������������������  

•요청����������� ������������������  사이즈����������� ������������������  *����������� ������������������  샤드����������� ������������������  갯수����������� ������������������  만큼����������� ������������������  반환

Page 10: Elastic search 검색

검색����������� ������������������  타입(cont’d)•dis_query_then_fetch����������� ������������������  

•query_then_fetch와����������� ������������������  유사,����������� ������������������  분산된����������� ������������������  키워드����������� ������������������  빈도를����������� ������������������  계산하는����������� ������������������  작업을����������� ������������������  추가����������� ������������������  실행����������� ������������������  

•dis_query_and_fetch����������� ������������������  

•query_and_fetch와����������� ������������������  유사,����������� ������������������  분산된����������� ������������������  키워드����������� ������������������  빈도를����������� ������������������  계산하는����������� ������������������  작업을����������� ������������������  추가����������� ������������������  실행����������� ������������������  

•count����������� ������������������  

•질의와����������� ������������������  일치하는����������� ������������������  문서의����������� ������������������  수만����������� ������������������  반환하는����������� ������������������  특수한����������� ������������������  타입의����������� ������������������  검색����������� ������������������  

•scan����������� ������������������  

•질의가����������� ������������������  엄청난����������� ������������������  결과를����������� ������������������  반환할����������� ������������������  경우����������� ������������������  사용����������� ������������������  

•첫����������� ������������������  요청으로����������� ������������������  스크롤����������� ������������������  식별자로����������� ������������������  응답,����������� ������������������  다음����������� ������������������  요청은����������� ������������������  스크롤����������� ������������������  식별자를����������� ������������������  통해����������� ������������������  수행

Page 11: Elastic search 검색

검색����������� ������������������  수행����������� ������������������  우선순위

•요청����������� ������������������  매개����������� ������������������  변수로����������� ������������������  지정����������� ������������������  

• ex)����������� ������������������  curl����������� ������������������  -XGET����������� ������������������  ‘localhost:9200/library/book/_search?pretty=true&preference=_primary'����������� ������������������  ����������� ������������������  

•_primary:����������� ������������������  검색����������� ������������������  연산은����������� ������������������  주����������� ������������������  샤드에서만����������� ������������������  

•_primary_first:����������� ������������������  주����������� ������������������  샤드가����������� ������������������  사용����������� ������������������  가능할����������� ������������������  경우����������� ������������������  검색����������� ������������������  연산����������� ������������������  수행����������� ������������������  

•_local:����������� ������������������  요청을����������� ������������������  받은����������� ������������������  노드에����������� ������������������  존재����������� ������������������  하는����������� ������������������  샤드만����������� ������������������  검색에����������� ������������������  사용����������� ������������������  

•_only_node:����������� ������������������  식별자로����������� ������������������  지정한����������� ������������������  노드의����������� ������������������  샤드에서만����������� ������������������  검색����������� ������������������  수행����������� ������������������  

•_prefer_node:����������� ������������������  식별자로����������� ������������������  지정한����������� ������������������  노드����������� ������������������  우선����������� ������������������  으로����������� ������������������  검색����������� ������������������  수행����������� ������������������  

•_shards:1,2:����������� ������������������  지정한����������� ������������������  샤드에����������� ������������������  대해서만����������� ������������������  검색����������� ������������������  수행

Page 12: Elastic search 검색

기본����������� ������������������  질의

{����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ..추가����������� ������������������  옵션..����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  "query":����������� ������������������  {����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  "<쿼리타입>":����������� ������������������  {����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  "<필드명>":����������� ������������������  {..����������� ������������������  질의문법..}����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  }����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  }����������� ������������������  } 필드명에����������� ������������������  _all을����������� ������������������  입력시����������� ������������������  전문검색

Page 13: Elastic search 검색

검색����������� ������������������  타입(cont’d)

•term����������� ������������������  질의����������� ������������������  

•주어진����������� ������������������  질의문이����������� ������������������  저장된����������� ������������������  텀과����������� ������������������  정확히����������� ������������������  일치하는����������� ������������������  내용을����������� ������������������  찾음����������� ������������������  

•만약����������� ������������������  not_analyzed로����������� ������������������  저장한����������� ������������������  경우����������� ������������������  전체����������� ������������������  문장이����������� ������������������  같아야����������� ������������������  함.����������� ������������������  

•terms����������� ������������������  질의����������� ������������������  

•2개����������� ������������������  이상의����������� ������������������  텀을����������� ������������������  같이����������� ������������������  검색할����������� ������������������  경우����������� ������������������  사용

Page 14: Elastic search 검색

검색����������� ������������������  타입(cont’d)

•match����������� ������������������  

• 질의문을����������� ������������������  적절한����������� ������������������  분석기한����������� ������������������  다음����������� ������������������  분석된����������� ������������������  질의문으로����������� ������������������  검색����������� ������������������  수행����������� ������������������  

• 추가����������� ������������������  옵션����������� ������������������  (부울����������� ������������������  표현식)을����������� ������������������  사용하여����������� ������������������  검색����������� ������������������  수행����������� ������������������  가능����������� ������������������  

• match_phrase:����������� ������������������  주어진����������� ������������������  질의문을����������� ������������������  단어가����������� ������������������  아닌����������� ������������������  하나의����������� ������������������  구문으로����������� ������������������  분석해����������� ������������������  쿼리를����������� ������������������  검색����������� ������������������  

• multi_phrase_prefix:����������� ������������������  phrase와����������� ������������������  유사,����������� ������������������  마지막����������� ������������������  키워드를����������� ������������������  대상으로����������� ������������������  접두어����������� ������������������  검색����������� ������������������  

• multi_match:����������� ������������������  단일����������� ������������������  필드����������� ������������������  대신����������� ������������������  여러����������� ������������������  필드를����������� ������������������  대상으로����������� ������������������  수행����������� ������������������  (fields)

Page 15: Elastic search 검색

검색����������� ������������������  타입(cont’d)•common����������� ������������������  

•불용어를����������� ������������������  사용할����������� ������������������  경우����������� ������������������  질의����������� ������������������  관련성을����������� ������������������  정확히����������� ������������������  계산하기����������� ������������������  위해����������� ������������������  사용����������� ������������������  

•질의를����������� ������������������  두����������� ������������������  그룹으로����������� ������������������  나누어����������� ������������������  질의����������� ������������������  

•1번째:����������� ������������������  중요하고,����������� ������������������  빈도가����������� ������������������  낮은����������� ������������������  단어����������� ������������������  

•2번째:����������� ������������������  중요하지����������� ������������������  않고,����������� ������������������  빈도가����������� ������������������  높은����������� ������������������  단어����������� ������������������  

•1번째����������� ������������������  그룹에����������� ������������������  대해����������� ������������������  질의를����������� ������������������  먼저����������� ������������������  수행하고,����������� ������������������  일치하는����������� ������������������  문서에����������� ������������������  대해서만����������� ������������������  2번째����������� ������������������  그룹으로����������� ������������������  질의

Page 16: Elastic search 검색

검색����������� ������������������  타입(cont’d)

•query_string����������� ������������������  

•문자열����������� ������������������  질의,����������� ������������������  완벽한����������� ������������������  아파치����������� ������������������  루씬����������� ������������������  질의����������� ������������������  구문을����������� ������������������  지원����������� ������������������  

•<필드명>:<질의문>����������� ������������������  형식으로����������� ������������������  필드를����������� ������������������  지정하거나����������� ������������������  AND,����������� ������������������  OR����������� ������������������  값을����������� ������������������  이용해����������� ������������������  조건문을����������� ������������������  사용����������� ������������������  가능����������� ������������������  

•?,����������� ������������������  *����������� ������������������  등����������� ������������������  와일드����������� ������������������  카드����������� ������������������  사용가능����������� ������������������  

•simple_query_string����������� ������������������  

•루씬의����������� ������������������  질의����������� ������������������  파서중����������� ������������������  하나인����������� ������������������  SimpleQuery����������� ������������������  파서����������� ������������������  사용����������� ������������������  

•질의에����������� ������������������  오류가����������� ������������������  발생하도,����������� ������������������  유효����������� ������������������  하지����������� ������������������  않은����������� ������������������  부분을����������� ������������������  버리고����������� ������������������  나머지를����������� ������������������  사용해����������� ������������������  질의

Page 17: Elastic search 검색

검색����������� ������������������  타입(cont’d)•ids����������� ������������������  

•배열에����������� ������������������  존재하는����������� ������������������  식별자와����������� ������������������  일치하는����������� ������������������  문서만����������� ������������������  반환(_uid)����������� ������������������  

•prefix����������� ������������������  

•term����������� ������������������  질의와����������� ������������������  유사,����������� ������������������  해당����������� ������������������  접두어로����������� ������������������  시작하는����������� ������������������  값이����������� ������������������  일치하는����������� ������������������  지����������� ������������������  검색����������� ������������������  

•fuzzy����������� ������������������  

•에디트����������� ������������������  거리����������� ������������������  알고리즘����������� ������������������  기반으로����������� ������������������  문서와����������� ������������������  일치하는지����������� ������������������  판단

Page 18: Elastic search 검색

검색����������� ������������������  타입(cont’d)•wildcard����������� ������������������  ����������� ������������������  

•검색어에����������� ������������������  와일드����������� ������������������  카드����������� ������������������  사용����������� ������������������  가능����������� ������������������  

•more_like_this����������� ������������������  

•제공된����������� ������������������  텍스트와����������� ������������������  유사한����������� ������������������  문서를����������� ������������������  검색����������� ������������������  

•추가적인����������� ������������������  옵션을����������� ������������������  사용하여,����������� ������������������  빈도수,����������� ������������������  단어의����������� ������������������  길이,����������� ������������������  퍼센트를����������� ������������������  사용하여����������� ������������������  유사도����������� ������������������  검사����������� ������������������  

•more_like_this_field����������� ������������������  

•more_like_this와����������� ������������������  유사하지만,����������� ������������������  단일����������� ������������������  필드에����������� ������������������  대해서만����������� ������������������  동작����������� ������������������  

•fuzzy_like_this:����������� ������������������  more_like_this와����������� ������������������  유사하지만����������� ������������������  fuzzy����������� ������������������  문자열을����������� ������������������  사용

Page 19: Elastic search 검색

검색����������� ������������������  타입(cont’d)•range����������� ������������������  ����������� ������������������  

•특정����������� ������������������  범위에����������� ������������������  속한����������� ������������������  필드값을����������� ������������������  포함한����������� ������������������  문서를����������� ������������������  검색����������� ������������������  

•필드는����������� ������������������  숫자����������� ������������������  혹은����������� ������������������  날짜����������� ������������������  타입만����������� ������������������  가능����������� ������������������  

•dismax����������� ������������������  

•점수가����������� ������������������  낮은����������� ������������������  하위����������� ������������������  질의가����������� ������������������  문서의����������� ������������������  최종����������� ������������������  점수에����������� ������������������  영향을����������� ������������������  미치는����������� ������������������  방법을����������� ������������������  통제����������� ������������������  가능����������� ������������������  

•점수의����������� ������������������  합에����������� ������������������  tie_breaker����������� ������������������  매개����������� ������������������  변수의����������� ������������������  값을����������� ������������������  곱하여����������� ������������������  최종����������� ������������������  문서의����������� ������������������  점수를����������� ������������������  계산����������� ������������������  

•regexp����������� ������������������  

•질의����������� ������������������  텍스트로����������� ������������������  정규����������� ������������������  표현식을����������� ������������������  사용

Page 20: Elastic search 검색

복합����������� ������������������  질의•여러����������� ������������������  질의를����������� ������������������  연결하거나����������� ������������������  질의����������� ������������������  동작����������� ������������������  방식을����������� ������������������  변경����������� ������������������  

•bool����������� ������������������  

•질의문을����������� ������������������  조건문인����������� ������������������  bool����������� ������������������  조합으로����������� ������������������  적용해서����������� ������������������  구성����������� ������������������  

•must,����������� ������������������  must_not,����������� ������������������  should����������� ������������������  

•boosting����������� ������������������  

•질의를����������� ������������������  통해����������� ������������������  해당하는����������� ������������������  문서의����������� ������������������  점수를����������� ������������������  낮춰야����������� ������������������  할때����������� ������������������  사용����������� ������������������  

•positive,����������� ������������������  negative,����������� ������������������  nagative_boot(낮추기����������� ������������������  위한����������� ������������������  중요도)

Page 21: Elastic search 검색

복합����������� ������������������  질의•constant_score����������� ������������������  

•감싼����������� ������������������  질의가����������� ������������������  반환하는����������� ������������������  문서의����������� ������������������  점수를����������� ������������������  명시한����������� ������������������  상수����������� ������������������  점수로����������� ������������������  반환����������� ������������������  

•indices����������� ������������������  

•여러����������� ������������������  색인에����������� ������������������  대한����������� ������������������  질의를����������� ������������������  수행����������� ������������������  

•질의중����������� ������������������  하나는����������� ������������������  목록에����������� ������������������  있는����������� ������������������  색인에����������� ������������������  질의����������� ������������������  

•다른����������� ������������������  하나는����������� ������������������  목록에����������� ������������������  없는����������� ������������������  색인에����������� ������������������  질의

Page 22: Elastic search 검색

Q&A

Page 23: Elastic search 검색

References• Rafat����������� ������������������  Kuc.,����������� ������������������  Marek����������� ������������������  Rogozinski.,����������� ������������������  전문����������� ������������������  검색과����������� ������������������  분석을����������� ������������������  위한����������� ������������������  

Elasticsearch����������� ������������������  서버(박재호����������� ������������������  옮김).����������� ������������������  경기도����������� ������������������  의왕시:����������� ������������������  에이콘출판(주),����������� ������������������  2014����������� ������������������  

• 김종민,����������� ������������������  시작하세요!����������� ������������������  엘라스틱서치.����������� ������������������  경기도����������� ������������������  파주시:����������� ������������������  위키북스,����������� ������������������  2015