mirror of https://github.com/apache/lucene.git
SOLR-1094 followup -- Fix for single correctly spelled word
git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@769357 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
809a559b63
commit
cf2cbe45df
|
@ -227,6 +227,8 @@ public class SpellCheckComponent extends SearchComponent implements SolrCoreAwar
|
|||
}
|
||||
if (hasFreqInfo) {
|
||||
result.add("correctlySpelled", isCorrectlySpelled);
|
||||
} else if(extendedResults && suggestions.size() == 0) { // if the word is misspelled, its added to suggestions with freqinfo
|
||||
result.add("correctlySpelled", true);
|
||||
}
|
||||
if (collate == true){
|
||||
StringBuilder collation = new StringBuilder(origQuery);
|
||||
|
|
|
@ -271,6 +271,19 @@ public class SpellCheckComponentTest extends AbstractSolrTestCase {
|
|||
|
||||
assertQ("Make sure correct spellings are signalled in the response", req,
|
||||
"//*[@numFound='0']", "//*/lst[@name='suggestions']", "//*/bool[@name='correctlySpelled'][.='false']");
|
||||
|
||||
|
||||
args = new HashMap<String, String>();
|
||||
|
||||
args.put(CommonParams.Q, "lowerfilt:lazy");
|
||||
args.put(CommonParams.QT, "spellCheckCompRH");
|
||||
args.put(SpellCheckComponent.SPELLCHECK_EXTENDED_RESULTS, "true");
|
||||
args.put(SpellCheckComponent.COMPONENT_NAME, "true");
|
||||
req = new LocalSolrQueryRequest(core, new MapSolrParams(
|
||||
args));
|
||||
|
||||
assertQ("Make sure correct spellings are signalled in the response", req,
|
||||
"//*[@numFound='1']", "//*/lst[@name='suggestions']", "//*/bool[@name='correctlySpelled'][.='true']");
|
||||
}
|
||||
|
||||
public void testInit() throws Exception {
|
||||
|
|
Loading…
Reference in New Issue