Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
8.8.1
-
None
-
None
Description
Reproduction Steps
1. Perform a query with a misspelled word capable of triggering spellcheck, with collations, and maxCollationTries. For e.g:
q=tust&spellcheck=on&spellcheck.count=5&spellcheck.collate=true&spellcheck.maxCollationTries=3
Confirm you get spellcheck suggestions with collations in the response and 0 results for the original query.
2. Now add an fq which will guarantee no results are returned for the main query and the (internal) collation queries, for example:
q=tust&spellcheck=on&spellcheck.count=5&spellcheck.collate=true&spellcheck.maxCollationTries=3&fq=id:someNonexistentId
Confirm now that you get no results as well as no collations (as expected).
3. Now add a spellcheck.collateParam.fq to try to override this fq for the collations, so that you should see a collation.
q=tust&spellcheck=on&spellcheck.count=5&spellcheck.collate=true&spellcheck.maxCollationTries=3&fq=id:someNonexistentId&spellcheck.collateParam.fq=*:*
Observe that the query still returns 0 results (as expected) but no collation is returned either (not expected).
We expect that if we specify spellcheck.collateParam.fq, when the collation query is performed to check collations, it should REPLACE the fq on the original query (as it does, for example, with changing the mm parameter via spellcheck.collateParam.mm). Thus, we should see the same collations returned as we saw in step 1.
For reference, here is the spellcheck config used for the above reproduction:
<searchComponent name="spellcheck" class="solr.SpellCheckComponent"> <str name="queryAnalyzerFieldType">text_general</str> <lst name="spellchecker"> <str name="name">default</str> <str name="field">spellcheck</str> <str name="classname">solr.DirectSolrSpellChecker</str> <str name="distanceMeasure">internal</str> <float name="accuracy">0.5</float> <int name="maxEdits">2</int> <int name="minPrefix">1</int> <int name="maxInspections">5</int> <int name="minQueryLength">4</int> <int name="maxQueryLength">20</int> <float name="thresholdTokenFrequency">.01</float> <float name="maxQueryFrequency">0.01</float> </lst> </searchComponent>