itschrispeck opened a new pull request, #13533: URL: https://github.com/apache/pinot/pull/13533
Lucene's query language has a constraint where `NOT` operator cannot be used with just one term, since it relies on the difference of sets. Therefore, the pinot query `x OR NOT y` and the lucene query `x OR NOT y` are not equivalent. Rather, `x OR NOT y` in Lucene is equivalent to simply `x`. This patch skips optimizing these cases to ensure query correctness. From the [Lucene docs](https://lucene.apache.org/core/9_8_0/queryparser/org/apache/lucene/queryparser/classic/package-summary.html#package.description): ``` Note: The NOT operator cannot be used with just one term. For example, the following search will return no results: ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org