Skip to content

Instantly share code, notes, and snippets.

@paveltimofeev
Last active August 29, 2015 14:23
Show Gist options
  • Save paveltimofeev/594a7759e2f077e8757f to your computer and use it in GitHub Desktop.
Save paveltimofeev/594a7759e2f077e8757f to your computer and use it in GitHub Desktop.
Elasticsearch queries
--------------------------------------------------
How to return objects wich contains empty array?
https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#query-string-syntax
[GET] /index/type/_search?q=-_exists_:array_field
[RESPONSE]:
"hits" :
{
...
"hits" :
[
{
"_index" : "index",
"_type" : "type",
"_id" : "id1",
"_score" : 1,
"_source" :
{
...,
"array_field" : [],
...
}
},
...
]
}
--------------------------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment