We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
{ "user": "jane" } { "user": "" } { "user": ["jane"] } { "user": ["jane", null ] } { "user": null } { "user": [] } { "user": [null] } { "foo": "bar" }
GET /_search { "query": { "exists" : { "field" : "user" } } }
{ "user": "jane" }
{ "user": "" }
{ "user": ["jane"] }
{ "user": ["jane", null] }
{ "user": null}
{ "user": [] }
{ "user": [null] }
{ "foo": "bar" }
PUT test_index { "mappings": { "test_type": { "properties": { "user": { "type": "keyword", "null_value": "NULL" } } } } }
null
NULL
위에서 만든 test_index에 데이터를 넣어보자
PUT test_index/test_type/1 { "user": null }
PUT test_index/test_type/2 { "user": [] }
전체 Documents 확인
{ "took": 0, "timed_out": false, "_shards": { "total": 5, "successful": 5, "skipped": 0, "failed": 0 }, "hits": { "total": 2, "max_score": 1, "hits": [ { "_index": "test_index", "_type": "test_type", "_id": "2", "_score": 1, "_source": { "user": [] } }, { "_index": "test_index", "_type": "test_type", "_id": "1", "_score": 1, "_source": { "user": null } } ] } }
query
GET test_index/_search { "query": { "term": { "user": "NULL" } } }
결과 : 위에서 _id가 1번인 document만 출력된다
{ "took": 0, "timed_out": false, "_shards": { "total": 5, "successful": 5, "skipped": 0, "failed": 0 }, "hits": { "total": 1, "max_score": 0.2876821, "hits": [ { "_index": "test_index", "_type": "test_type", "_id": "1", "_score": 0.2876821, "_source": { "user": null } } ] } }
The text was updated successfully, but these errors were encountered:
higee
No branches or pull requests
조회하려는 필드에 적어도 한 개의 null이 아닌 값이 있는 Documents를 검색한다
{ "user": "jane" }
{ "user": "" }
{ "user": ["jane"] }
{ "user": ["jane", null] }
{ "user": null}
{ "user": [] }
{ "user": [null] }
{ "foo": "bar" }
null
로 들어온 value를NULL
이라는 string으로 변환{ "user": "jane" }
{ "user": "" }
{ "user": ["jane"] }
{ "user": ["jane", null] }
{ "user": null}
NULL
변환되어 non-null value 존재{ "user": [] }
{ "user": [null] }
NULL
변환되어 non-null value 존재{ "foo": "bar" }
위에서 만든 test_index에 데이터를 넣어보자
null
null
전체 Documents 확인
query
결과 : 위에서 _id가 1번인 document만 출력된다
The text was updated successfully, but these errors were encountered: