risdenk commented on code in PR #820:
URL: https://github.com/apache/solr/pull/820#discussion_r857909998


##########
solr/core/src/test/org/apache/solr/spelling/DirectSolrSpellCheckerTest.java:
##########
@@ -70,7 +71,7 @@ public void test() throws Exception {
               SpellingOptions spellOpts = new SpellingOptions(tokens, 
searcher.getIndexReader());
               SpellingResult result = checker.getSuggestions(spellOpts);
               assertNotNull("result shouldn't be null", result);
-              Map<String, Integer> suggestions = 
result.get(tokens.iterator().next());
+              Map<String, Integer> suggestions = 
result.get(spellOpts.tokens.iterator().next());

Review Comment:
   All of thse `spellOpts.tokens` changes are to make sure that suggestions are 
checked for the right word. Previously a lot of these tests were iterating on 
the wrong variable so would get null suggestions. This was just a misuse in the 
test.



##########
solr/core/src/test/org/apache/solr/spelling/DirectSolrSpellCheckerTest.java:
##########
@@ -70,7 +71,7 @@ public void test() throws Exception {
               SpellingOptions spellOpts = new SpellingOptions(tokens, 
searcher.getIndexReader());
               SpellingResult result = checker.getSuggestions(spellOpts);
               assertNotNull("result shouldn't be null", result);
-              Map<String, Integer> suggestions = 
result.get(tokens.iterator().next());
+              Map<String, Integer> suggestions = 
result.get(spellOpts.tokens.iterator().next());

Review Comment:
   All of these `spellOpts.tokens` changes are to make sure that suggestions 
are checked for the right word. Previously a lot of these tests were iterating 
on the wrong variable so would get null suggestions. This was just a misuse in 
the test.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to