[
https://issues.apache.org/jira/browse/SOLR-5122?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Hoss Man updated SOLR-5122:
---------------------------
Attachment: SOLR-5122.patch
Attached patch applied to trunk r1511141 produces the following error...
{noformat}
[junit4] 2> 6500 T10 C1 oasc.SolrCore.execute [collection1] webapp=null
path=null
params={spellcheck=true&spellcheck.dictionary=direct&spellcheck.count=1&spellcheck.collate=true&spellcheck.maxCollationTries=1&spellcheck.maxCollations=1&spellcheck.collateExtendedResults=true&qt=spellCheckCompRH&q=teststop%3Ametnoia&spellcheck.collateMaxCollectDocs=5}
hits=0 status=500 QTime=25
[junit4] 2> 6501 T10 oasc.SolrException.log ERROR REQUEST FAILED:
spellcheck=true&spellcheck.dictionary=direct&spellcheck.count=1&spellcheck.collate=true&spellcheck.maxCollationTries=1&spellcheck.maxCollations=1&spellcheck.collateExtendedResults=true&qt=spellCheckCompRH&q=teststop%3Ametnoia&spellcheck.collateMaxCollectDocs=5:java.lang.ArithmeticException:
/ by zero
[junit4] 2> at
org.apache.solr.spelling.SpellCheckCollator.collate(SpellCheckCollator.java:153)
[junit4] 2> at
org.apache.solr.handler.component.SpellCheckComponent.addCollationsToResponse(SpellCheckComponent.java:229)
[junit4] 2> at
org.apache.solr.handler.component.SpellCheckComponent.process(SpellCheckComponent.java:196)
[junit4] 2> at
org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:208)
[junit4] 2> at
org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:135)
[junit4] 2> at
org.apache.solr.core.SolrCore.execute(SolrCore.java:1845)
[junit4] 2> at
org.apache.solr.util.TestHarness.query(TestHarness.java:292)
[junit4] 2> at
org.apache.solr.util.TestHarness.query(TestHarness.java:274)
[junit4] 2> at
org.apache.solr.SolrTestCaseJ4.assertQ(SolrTestCaseJ4.java:609)
[junit4] 2> at
org.apache.solr.SolrTestCaseJ4.assertQ(SolrTestCaseJ4.java:602)
[junit4] 2> at
org.apache.solr.spelling.SpellCheckCollatorTest.testEstimatedHitCounts(SpellCheckCollatorTest.java:475)
...
[junit4] 2> 6501 T10 oas.SolrTestCaseJ4.tearDown ###Ending
testEstimatedHitCounts
[junit4] 2> NOTE: reproduce with: ant test
-Dtestcase=SpellCheckCollatorTest -Dtests.method=testEstimatedHitCounts
-Dtests.seed=16B4D8F74E59EE10 -Dtests.multiplier=2 -Dtests.nightly=true
-Dtests.slow=true -Dtests.locale=nl -Dtests.timezone=America/Dawson
-Dtests.file.encoding=US-ASCII
[junit4] ERROR 0.35s | SpellCheckCollatorTest.testEstimatedHitCounts <<<
[junit4] > Throwable #1: java.lang.RuntimeException: Exception during
query
[junit4] > at
__randomizedtesting.SeedInfo.seed([16B4D8F74E59EE10:270F66C2EB66FEC0]:0)
[junit4] > at
org.apache.solr.SolrTestCaseJ4.assertQ(SolrTestCaseJ4.java:635)
[junit4] > at
org.apache.solr.SolrTestCaseJ4.assertQ(SolrTestCaseJ4.java:602)
[junit4] > at
org.apache.solr.spelling.SpellCheckCollatorTest.testEstimatedHitCounts(SpellCheckCollatorTest.java:475)
[junit4] > at java.lang.Thread.run(Thread.java:724)
[junit4] > Caused by: java.lang.ArithmeticException: / by zero
[junit4] > at
org.apache.solr.spelling.SpellCheckCollator.collate(SpellCheckCollator.java:153)
[junit4] > at
org.apache.solr.handler.component.SpellCheckComponent.addCollationsToResponse(SpellCheckComponent.java:229)
[junit4] > at
org.apache.solr.handler.component.SpellCheckComponent.process(SpellCheckComponent.java:196)
[junit4] > at
org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:208)
[junit4] > at
org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:135)
[junit4] > at
org.apache.solr.core.SolrCore.execute(SolrCore.java:1845)
[junit4] > at
org.apache.solr.util.TestHarness.query(TestHarness.java:292)
[junit4] > at
org.apache.solr.util.TestHarness.query(TestHarness.java:274)
[junit4] > at
org.apache.solr.SolrTestCaseJ4.assertQ(SolrTestCaseJ4.java:609)
[junit4] > ... 42 more
{noformat}
> "ArithmeticException: / by zero" using spellcheck.collateMaxCollectDocs
> -----------------------------------------------------------------------
>
> Key: SOLR-5122
> URL: https://issues.apache.org/jira/browse/SOLR-5122
> Project: Solr
> Issue Type: Bug
> Affects Versions: 4.4
> Reporter: Hoss Man
> Attachments: SOLR-5122.patch
>
>
> As part of SOLR-4952 SpellCheckCollatorTest started using RandomMergePolicy,
> and this (aparently) led to a failure in testEstimatedHitCounts.
> As far as i can tell: the test assumes that specific values would be returned
> as the _estimated_ "hits" for a colleation, and it appears that the change in
> MergePolicy however resulted in different segments with different term stats,
> causing the estimation code to produce different values then what is expected.
> I made a quick attempt to improve the test to:
> * expect explicit exact values only when spellcheck.collateMaxCollectDocs is
> set such that the "estimate' should actually be exact (ie:
> collateMaxCollectDocs == 0 or collateMaxCollectDocs greater then the num
> docs in the index
> * randomize the values used for collateMaxCollectDocs and confirm that the
> estimates are never more then the num docs in the index
> This lead to an odd "ArithmeticException: / by zero" error in the test, which
> seems to suggest that there is a genuine bug in the code that only gets
> tickled in certain mergepolicy/segment/collateMaxCollectDocs combinations.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]