You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "David Smiley (Jira)" <ji...@apache.org> on 2026/08/13 16:21:00 UTC
[jira] [Resolved] (SOLR-18256) Auto-fix pure negative (NOT) clauses in the "lucene" QParser
[ https://issues.apache.org/jira/browse/SOLR-18256?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
David Smiley resolved SOLR-18256.
---------------------------------
Fix Version/s: 10.1
Resolution: Fixed
> Auto-fix pure negative (NOT) clauses in the "lucene" QParser
> ------------------------------------------------------------
>
> Key: SOLR-18256
> URL: https://issues.apache.org/jira/browse/SOLR-18256
> Project: Solr
> Issue Type: Improvement
> Reporter: David Smiley
> Priority: Major
> Labels: newdev, pull-request-available
> Fix For: 10.1
>
> Time Spent: 1h 40m
> Remaining Estimate: 0h
>
> When the lucene query parser parses a negative query — one where all boolean clauses are prohibited, such as {{NOT bar}} , possibly as a sub-expression (parenthesis wrapped) — the resulting {{BooleanQuery}} matches no documents. This is not what people intuitively expect. I've seen code work around this, and it's really annoying. I've also seen code _forget_ to do this, resulting in undesired behavior. This has been a long-standing gotcha to stub your toe on with Solr development.
> While it can be argued the fix should be in Lucene, I think Lucene is stubborn on this point, as there is _some_ sense in the current behavior. I may pursue an opt-in improvement to BooleanQuery.Builder.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org