And I would like to execute a query that returns only the documents that have a nested object with category=position and tag=2300 AND a nested object with category=scope and tag=Internal . objectNumber 2 and 3 but not 1.
please take your time to properly format your JSON, as it makes things much easier to read, especially in such a case where formatting is so crucial due to be able to understand the query
how about a single bool query, with two filter clauses. Each of those clauses is a nested query, which in turn is a bool query with two filter clauses for category and the tag field.
I have been working on following your guidance but keep struggling with how to pair two filter queries with each other. I keep getting different forms of :
"[filtered] query malformed, no start_object after query name"
Is there documentation on how things should be nested and how to properly setup arrays of queries?
Here is as far as I've gotten. I think I'm just missing brackets or something.
My sense is there are other ways to structure this as well. I'll keep playing until I understand all the ins and outs. Is there a guide to what can be an array and what cannot?
in a bool query, every leaf can be an array, as it can contain an arbitrary number of sub queries including nesting more bool queries. Most other queries cannot have an array for their clauses on top of my head.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.