Convert Boolean (Generic) to Lucene
Turn a plain Boolean query into Lucene syntax for Elasticsearch, OpenSearch, or any Lucene-backed index.
Once the syntax is sorted
Three different situations, depending on how far along the move is.
Reference
Worked example
Boolean (Generic)'s syntax here is already valid Lucene syntax, so nothing changes on the way through. That is the point: this particular query needs no rewriting at all.
Boolean (Generic) query
(python OR rust) AND async AND NOT java
Lucene output
(python OR rust) AND async AND NOT java
What carries over, and what does not
Carries over
- •Boolean AND / OR / NOT
- •Wildcards
Degrades or drops
- •An OR chain over 500 branches is truncated to 500 (an engine-wide limit, not specific to Lucene)