You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "Chris M. Hostetter (Jira)" <ji...@apache.org> on 2020/01/08 19:16:00 UTC
[jira] [Reopened] (SOLR-11746) numeric fields need better error
handling for prefix/wildcard syntax -- consider uniform support for "foo:*
== foo:[* TO *]"
[ https://issues.apache.org/jira/browse/SOLR-11746?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Chris M. Hostetter reopened SOLR-11746:
---------------------------------------
something about this change appears to have broken "range search" for numeric float (and possibly double?) fields when dealing with "NaN" in indexed documents
Jenkins found the following reproducing failing seed on master...
[http://fucit.org/solr-jenkins-reports/job-data/thetaphi/Lucene-Solr-master-Linux/25286]
{noformat}
[junit4] 2> 2210525 INFO (TEST-DocValuesTest.testFloatAndDoubleRangeQueryRandom-seed#[71B4E4F64D35520]) [ ] o.a.s.s.DocValuesTest Expected: [//*[@numFound='5'], //result/doc[1]/st
r[@name='id'][.=1], //result/doc[1]/float[@name='score'][.=1.0], //result/doc[2]/str[@name='id'][.=2], //result/doc[2]/float[@name='score'][.=1.0], //result/doc[3]/str[@name='id'][.=3], //r
esult/doc[3]/float[@name='score'][.=1.0], //result/doc[4]/str[@name='id'][.=5], //result/doc[4]/float[@name='score'][.=1.0], //result/doc[5]/str[@name='id'][.=6], //result/doc[5]/float[@nam
e='score'][.=1.0]]
[junit4] 2> 2210525 INFO (TEST-DocValuesTest.testFloatAndDoubleRangeQueryRandom-seed#[71B4E4F64D35520]) [ ] o.a.s.c.S.Request [collection1] webapp=null path=null params={q=floatd
v:{*+TO+*}&fl=id,floatdv,score&sort=id_i+asc&wt=xml} hits=6 status=0 QTime=0
[junit4] 2> 2210525 ERROR (TEST-DocValuesTest.testFloatAndDoubleRangeQueryRandom-seed#[71B4E4F64D35520]) [ ] o.a.s.SolrTestCaseJ4 REQUEST FAILED: xpath=//*[@numFound='5']
[junit4] 2> xml response was: <?xml version="1.0" encoding="UTF-8"?>
[junit4] 2> <response>
[junit4] 2> <lst name="responseHeader"><int name="status">0</int><int name="QTime">0</int></lst><result name="response" numFound="6" start="0" maxScore="1.0"><doc><str name="id">1</str
><float name="floatdv">-5.9166734E-15</float><float name="score">1.0</float></doc><doc><str name="id">2</str><float name="floatdv">1.6398867E38</float><float name="score">1.0</float></doc><
doc><str name="id">3</str><float name="floatdv">-4.211542E-32</float><float name="score">1.0</float></doc><doc><str name="id">4</str><float name="floatdv">NaN</float><float name="score">1.0
</float></doc><doc><str name="id">5</str><float name="floatdv">-3.1379082E32</float><float name="score">1.0</float></doc><doc><str name="id">6</str><float name="floatdv">3407.986</float><fl
oat name="score">1.0</float></doc></result>
[junit4] 2> </response>
...
[junit4] 2> NOTE: reproduce with: ant test -Dtestcase=DocValuesTest -Dtests.method=testFloatAndDoubleRangeQueryRandom -Dtests.seed=71B4E4F64D35520 -Dtests.multiplier=3 -Dtests.slow=true -Dtests.locale=ksf -Dtests.timezone=Asia/Yangon -Dtests.asserts=true -Dtests.file.encoding=UTF-8
[junit4] ERROR 0.14s J0 | DocValuesTest.testFloatAndDoubleRangeQueryRandom <<<
[junit4] > Throwable #1: java.lang.RuntimeException: Exception during query
[junit4] > at __randomizedtesting.SeedInfo.seed([71B4E4F64D35520:3F8B601CA87B4CBB]:0)
[junit4] > at org.apache.solr.SolrTestCaseJ4.assertQ(SolrTestCaseJ4.java:1002)
[junit4] > at org.apache.solr.SolrTestCaseJ4.assertQ(SolrTestCaseJ4.java:962)
[junit4] > at org.apache.solr.schema.DocValuesTest.testFloatAndDoubleRangeQueryRandom(DocValuesTest.java:632)
[junit4] > at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[junit4] > at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[junit4] > at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[junit4] > at java.base/java.lang.reflect.Method.invoke(Method.java:564)
[junit4] > at java.base/java.lang.Thread.run(Thread.java:832)
[junit4] > Caused by: java.lang.RuntimeException: REQUEST FAILED: xpath=//*[@numFound='5']
[junit4] > xml response was: <?xml version="1.0" encoding="UTF-8"?>
[junit4] > <response>
[junit4] > <lst name="responseHeader"><int name="status">0</int><int name="QTime">0</int></lst><result name="response" numFound="6" start="0" maxScore="1.0"><doc><str name="id">1</str><float name="floatdv">-5.9166734E-15</float><float name="score">1.0</float></doc><doc><str name="id">2</str><float name="floatdv">1.6398867E38</float><float name="score">1.0</float></doc><doc><str name="id">3</str><float name="floatdv">-4.211542E-32</float><float name="score">1.0</float></doc><doc><str name="id">4</str><float name="floatdv">NaN</float><float name="score">1.0</float></doc><doc><str name="id">5</str><float name="floatdv">-3.1379082E32</float><float name="score">1.0</float></doc><doc><str name="id">6</str><float name="floatdv">3407.986</float><float name="score">1.0</float></doc></result>
[junit4] > </response>
[junit4] > request was:q=floatdv:{*+TO+*}&fl=id,floatdv,score&sort=id_i+asc&wt=xml
[junit4] > at org.apache.solr.SolrTestCaseJ4.assertQ(SolrTestCaseJ4.java:995)
[junit4] > ... 41 more
{noformat}
This seed reprodces reliably for me as of f5ab3ca688b3127bece252ffd87cc8bfa9f285ff, but not for the commit just prior to this change (b6f31835ad18da0f7a22064481b0d0e167f9f30c)
> numeric fields need better error handling for prefix/wildcard syntax -- consider uniform support for "foo:* == foo:[* TO *]"
> ----------------------------------------------------------------------------------------------------------------------------
>
> Key: SOLR-11746
> URL: https://issues.apache.org/jira/browse/SOLR-11746
> Project: Solr
> Issue Type: Bug
> Affects Versions: 7.0
> Reporter: Chris M. Hostetter
> Assignee: Houston Putman
> Priority: Major
> Fix For: master (9.0), 8.5
>
> Attachments: SOLR-11746.patch, SOLR-11746.patch, SOLR-11746.patch, SOLR-11746.patch, SOLR-11746.patch, SOLR-11746.patch
>
>
> On the solr-user mailing list, Torsten Krah pointed out that with Trie numeric fields, query syntax such as {{foo_d:\*}} has been functionality equivilent to {{foo_d:\[\* TO \*]}} and asked why this was not also supported for Point based numeric fields.
> The fact that this type of syntax works (for {{indexed="true"}} Trie fields) appears to have been an (untested, undocumented) fluke of Trie fields given that they use indexed terms for the (encoded) numeric terms and inherit the default implementation of {{FieldType.getPrefixQuery}} which produces a prefix query against the {{""}} (empty string) term.
> (Note that this syntax has aparently _*never*_ worked for Trie fields with {{indexed="false" docValues="true"}} )
> In general, we should assess the behavior users attempt a prefix/wildcard syntax query against numeric fields, as currently the behavior is largely non-sensical: prefix/wildcard syntax frequently match no docs w/o any sort of error, and the aformentioned {{numeric_field:*}} behaves inconsistently between points/trie fields and between indexed/docValued trie fields.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org