[ 
https://issues.apache.org/jira/browse/LUCENE-7276?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15318531#comment-15318531
 ] 

David Smiley commented on LUCENE-7276:
--------------------------------------

I can understand if you feel you want to break up the issue for whatever 
reason, and to be cautious about backwards-compatibility (thus delaying parts 
of this issue to 7.0?)

I don't think we should have guarantees that a Query.toString() will be 
parseable by Lucene's classic QueryParser.  That is not the case today for many 
queries, but for the common core queries, it's probably true.  And good point 
that if some app out there depends on this behavior, we might not want to 
introduce the change in 6.x of BooleanQuery optimizing to MatchNoDocsQuery.

> Add an optional reason to the MatchNoDocsQuery
> ----------------------------------------------
>
>                 Key: LUCENE-7276
>                 URL: https://issues.apache.org/jira/browse/LUCENE-7276
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: core/search
>            Reporter: Ferenczi Jim
>            Priority: Minor
>              Labels: patch
>         Attachments: LUCENE-7276.patch, LUCENE-7276.patch, LUCENE-7276.patch, 
> LUCENE-7276.patch, LUCENE-7276.patch
>
>
> It's sometimes difficult to debug a query that results in a MatchNoDocsQuery. 
> The MatchNoDocsQuery is always rewritten in an empty boolean query.
> This patch adds an optional reason and implements a weight in order to keep 
> track of the reason why the query did not match any document. The reason is 
> printed on toString and when an explanation for noMatch is asked.  
> For instance the query:
> new MatchNoDocsQuery("Field not found").toString()
> => 'MatchNoDocsQuery["field 'title' not found"]'



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to