[Filters]
기본적으로 filtered query 에서 동작 방식을 소개 했기 때문에 이 점을 이해하고 보셔야 합니다.
[and/or]
- 쿼리 결과에 대한 추가 쿼리의 and/or 연산을 수행 합니다.
- 쿼리 결과를 cache 하고 싶을 경우 _cache:true 설정을 하면 됩니다.
[bool]
- boolean 쿼리를 추가 수행 합니다.
[exists]
- 결과에 대해서 항상 cache 합니다.
[ids]
- ids 를 포함한 문서를 필터 합니다.
[limit]
- shard 당 문서 수를 제한 합니다.
[type]
- document/mapping type 에 대한 filter 합니다.
[missing]
- 문서의 특정 필드 값이 no value 인 것을 filter 합니다.
- 지정된 field 는 null_value 를 갖습니다.
- 예제가 직관적이기 떄문에 추가 합니다.
{ "constant_score" : { "filter" : { "missing" : { "field" : "user", "existence" : true, "null_value" : true } } } }
[not]
- 질의된 결과에 대해서 추가로 주어진 not filter 로 match 된 문서를 제외 합니다.
[numeric range]
- range filter와 유사하며, 어떤 수의 범위를 갖습니다.
- 주어진 parameters 는 아래와 같습니다.
Name | Description |
---|---|
from | The lower bound. Defaults to start from the first. |
to | The upper bound. Defaults to unbounded. |
include_lower | Should the first from (if set) be inclusive or not. Defaults to true |
include_upper | Should the last to (if set) be inclusive or not. Defaults to true . |
gt | Same as setting from and include_lower to false . |
gte | Same as setting from and include_lower to true . |
lt | Same as setting to and include_upper to false . |
lte | Same as setting to and include_upper to true . |
[prefix]
- phrase query 와 유사하며, prefix query 참고
[query]
- 추가 query 를 생성 할 수 있습니다.
[range]
- range query 참고
[script]
- script 를 이용한 filter 를 적용 할 수 있습니다.
[term]
- term query 참고
[terms]
- terms query 참고
- execution mode 를 지원 합니다.
- 기본 plain 그리고 bool, and, or 지원
[nested]
- nested query 참고
'elasticsearch-logstash' 카테고리의 다른 글
elasticsearch 필터 조합하기, 쿼리 조합하기 (0) | 2016.05.03 |
---|---|
elasticsearch query 참고! 한글!!!! (0) | 2016.05.02 |
fluentd plugin elasticsearch option (0) | 2016.04.14 |
logstash에 대한 설명 -퍼옴 (0) | 2016.04.11 |
단일서버 분산환경 예제 2 (0) | 2016.04.08 |