Andrew Shumway created SOLR-15380:
-------------------------------------
Summary: spellcheck.maxResultsForSuggest behavior does not match
documentation
Key: SOLR-15380
URL: https://issues.apache.org/jira/browse/SOLR-15380
Project: Solr
Issue Type: Bug
Security Level: Public (Default Security Level. Issues are Public)
Components: spellchecker
Reporter: Andrew Shumway
spellcheck.maxResultsForSuggest has two problems.
First, setting this to zero gives behavior which does not match the
documentation. The reason is that, unlike most other Solr parameters which
uses `-1` for the any/all use-case, this parameter uses 0. The effect is that
the valid zero-results use-case is invalidated. For example, if a high-volume
site doesn't want to spend time calculating spellcheck unless no results are
returned, they can't set this to 0.
Second, regardless of whether or not the setting turns off spellcheck, the
debug.timings.process.spellcheck reports significant time spent in spellcheck.
What this means is that the operation is not being skipped, rather the output
is simply suppressed. In my opinion that makes the setting 99.9% useless.
While this (second) behavior does not contradict the documentation, the fact
that this obvious use-case is not addressed is not noted. Best to
short-circuit and save the time IMO
To test, I ran a query (which uses a fq to return two results) and then using
jq, I extracted the numFound, maxResultsForSuggest setting, time spent on
spellcheck and correctlySpelled results. Then I would vary the
maxResultsForSuggest number
{code:java}
curl
"http://$SERVER:8983/solr/$COLLECTION/select?rows=2&fq=emageEDC=(3102175%204201641)&debug=timing&fl=id&q=https%20product%20tripp-lite-usb2.0-universal-reversible-a-to-mini-b-gold-device-cable-a-male-to-5pin-mini-b-male-3%20ft%20ur030-003%2016131013%20cac%20nested&rows=1&spellcheck.collate=true&spellcheck.dictionary=default&spellcheck.dictionary=wordbreak&spellcheck.extendedResults=true&spellcheck.maxCollationTries=10&spellcheck.maxCollations=10&spellcheck.q=https%20product%20tripp-lite-usb2.0-universal-reversible-a-to-mini-b-gold-device-cable-a-male-to-5pin-mini-b-male-3%20ft%20ur030-003%2016131013%20cac%20nested&spellcheck=on&spellcheck.maxResultsForSuggest=${MRS:0}"
|\
jq '{"numFound":.response.numFound, "spTime":
.debug.timing.process.spellcheck.time,"correctlySpelled":.spellcheck.correctlySpelled,"maxResultsForSuggest":.responseHeader.params["spellcheck.maxResultsForSuggest"]}'
{code}
In all cases, whether the maxResultsForSuggest was 3,2,1,0 significant time is
spent in doing spellcheck
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]