[
https://issues.apache.org/jira/browse/LUCENE-7276?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Michael McCandless resolved LUCENE-7276.
----------------------------------------
Resolution: Fixed
Fix Version/s: 6.2
master (7.0)
Thanks [~jim.ferenczi]!
> 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
> Fix For: master (7.0), 6.2
>
> Attachments: LUCENE-7276.patch, 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]