[ 
https://issues.apache.org/jira/browse/LUCENE-7276?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael McCandless updated LUCENE-7276:
---------------------------------------
    Attachment: LUCENE-7276.patch

I tweaked the patch a bit (fixed whitespace, fixed some failing test cases), 
but now I hit this curious failure:

{noformat}
   [junit4]   1> query: (#*:* *:* (-*:*) -(#body:b #(()^4.0)^10.0)^2.0)~1
   [junit4]   1>   after rewrite: (#*:* *:* MatchNoDocsQuery[""] -(#body:b 
#()^40.0)^2.0)~1
   [junit4]   2> NOTE: reproduce with: ant test  -Dtestcase=TestBooleanRewrites 
-Dtests.method=testRandom -Dtests.seed=FAE50D783718C6BE -Dtests.locale=sv 
-Dtests.timezone=Navajo -Dtests.asserts=true -Dtests.file.encoding=US-ASCII
   [junit4] FAILURE 0.33s | TestBooleanRewrites.testRandom <<<
   [junit4]    > Throwable #1: java.lang.AssertionError: doc=0 
expected:<0.3535533845424652> but was:<0.5>
   [junit4]    >        at 
__randomizedtesting.SeedInfo.seed([FAE50D783718C6BE:88A92877867870CD]:0)
   [junit4]    >        at 
org.apache.lucene.search.TestBooleanRewrites.assertEquals(TestBooleanRewrites.java:346)
   [junit4]    >        at 
org.apache.lucene.search.TestBooleanRewrites.testRandom(TestBooleanRewrites.java:290)
   [junit4]    >        at java.lang.Thread.run(Thread.java:745)
   [junit4]   2> NOTE: test params are: codec=Asserting(Lucene62): 
{body=TestBloomFilteredLucenePostings(BloomFilteringPostingsFormat(Lucene50(blocksize=128)))},
 docValues:{}, maxPointsInLeafNode=367, maxMBSortInHeap=6.926568898697452, 
sim=ClassicSimilarity, locale=sv, timezone=Navajo
   [junit4]   2> NOTE: Linux 3.13.0-87-generic amd64/Oracle Corporation 
1.8.0_60 (64-bit)/cpus=8,threads=1,free=399197264,total=504889344
   [junit4]   2> NOTE: All tests run in this JVM: [TestBooleanRewrites]
{noformat}

Somehow the test is angry that the rewritten query scores differently from the 
original ... so somehow the fact that we no longer rewrite to an empty BQ is 
changing something ... I'll dig.

> 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
>
>
> 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: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to