I'd probably just collapse everything into a filtered query. Something like 
this:

{
  "query": {
    "filtered": {
      "filter": {
        "bool": {
          "must": [
            {
              "terms": {
                "index_ids": ["2134616789944"]
              }
            }
          ],
          "should": [
            {
              "terms": {
                "trashed_at": "0"
              }
            },
            {
              "not": {
                "exists": {
                  "field": "trashed_at"
                }
              }
            }
          ]
        }
      }
    }
  }
}

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/0845cbee-26bb-43be-9318-7a36a08e6504%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to