1) You likely want a term filter:

{
  "query": {
    "filtered": {
      "filter": {
        "term": {
          "searchItems.ifpresent": 1
        }
      }
    }
  }
}

2) If your document is structured like above, you cannot extract only a 
partial (searchItems element) that matches your criteria. The search will 
return your document in its entirety. You could filter out parts of the 
document being returned (but not by your search criteria)

-- 
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/938bc11b-48a8-45d4-ad75-dfc036028ea2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to