Skip to content

Instantly share code, notes, and snippets.

@digitalkaoz
Last active December 30, 2015 12:09
Show Gist options
  • Save digitalkaoz/7827078 to your computer and use it in GitHub Desktop.
Save digitalkaoz/7827078 to your computer and use it in GitHub Desktop.
Elasticsearch Query Filtering...
[
{ "id" : 1, "type" : "Article", "title" : "A" },
{ "id" : 2, "type" : "Video", "title" : "B" },
{ "id" : 3, "type" : "Article", "title" : "C" },
{ "id" : 4, "type" : "Article", "title" : "D" },
{ "id" : 5, "type" : "Video", "title" : "E" },
{ "id" : 6, "type" : "Article", "title" : "F" },
{ "id" : 7, "type" : "Article", "title" : "G" },
{ "id" : 8, "type" : "Video", "title" : "H" },
{ "id" : 9, "type" : "Article", "title" : "I" },
{ "id" : 10, "type" : "Video", "title" : "J" }
]
@digitalkaoz
Copy link
Author

how to find the following all elements but not the first 2 of "type" : "Video" so the Result would be

[
    { "id" : 1, "type"   : "Article", "title" : "A" },
    { "id" : 3, "type"   : "Article", "title" : "C" },
    { "id" : 4, "type"   : "Article", "title" : "D" },
    { "id" : 6, "type"   : "Article", "title" : "F" },
    { "id" : 7, "type"   : "Article", "title" : "G" },
    { "id" : 8, "type"   : "Video",  "title" : "H" },
    { "id" : 9, "type"   : "Article", "title" : "I" },
    { "id" : 10, "type" : "Video",  "title" : "J" }
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment