Skip to content

Apache Lucene open-source search software

SOLR-698 -- SpellCheckComponent should use the queryString set in the ResponseBuilder before trying to use CommonParams.Q

Shalin Shekhar Mangarc80333e213b6
diff --git a/src/java/org/apache/solr/handler/component/SpellCheckComponent.java b/src/java/org/apache/solr/handler/component/SpellCheckComponent.java
index 725ceed78f2..23f4ce3f7fd 100644
--- a/src/java/org/apache/solr/handler/component/SpellCheckComponent.java
+++ b/src/java/org/apache/solr/handler/component/SpellCheckComponent.java
@@ -127,7 +127,10 @@ public class SpellCheckComponent extends SearchComponent implements SolrCoreAwar
//we have a spell check param, tokenize it with the query analyzer applicable for this spellchecker
tokens = getTokens(q, spellChecker.getQueryAnalyzer());
} else {
- q = params.get(CommonParams.Q);
+ q = rb.getQueryString();
+ if (q == null) {
+ q = params.get(CommonParams.Q);
+ }
tokens = queryConverter.convert(q);
}
if (tokens != null && tokens.isEmpty() == false) {