I need to implement the following predicate with Lucene query language:
{param} IN optionIds
where {param}
is my external parameter and optionIds
is an array(or collection).
for example I have the document with the following optionIds
:
"optionIds": [
72,
44,
11,
9,
10
]
The following Lucene predicate optionIds:72
correctly returns this document.
But how to return this document based on the follownig values: 72, 11, 9
The following predicate optionIds:72, 11, 9
doesn't work and the Lucene query returns the empty result.
Please show how to properly use(emulate) IN
operation in Lucene query language with arrays(collections). Also, please show how to use ALL IN/ANY IN
.
To match any of the query terms to list in the document:
optionIds:(72 11 9)
To match all of the query terms:
optionIds:(+72 +11 +9)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With