Apache Solr open-source search software
LUCENE-882: Spellchecker doesn't need to store ngrams
Daniel Naber52acd10f638c
diff --git a/CHANGES.txt b/CHANGES.txtindex c39fd07253d..bfe12d63fcd 100644--- a/CHANGES.txt+++ b/CHANGES.txt@@ -166,7 +166,11 @@ OptimizationsTestBoolean2 test to keep passing.(Paul Elschot via Otis Gospodnetic)-Documentation:+ 4. LUCENE-882: Spellchecker doesn't store the ngrams anymore but only indexes+ them to keep the spell index small. (Daniel Naber)++Documentation+1. LUCENE 791 && INFRA-1173: Infrastructure moved the Wiki to http://wiki.apache.org/lucene-java/ Updated the links in the docs and wherever else I found references. (Grant Ingersoll, Joe Schaefer)2. Fixed the javadoc for ScoreDocComparator.compare() to be consistent withdiff --git a/contrib/spellchecker/src/java/org/apache/lucene/search/spell/SpellChecker.java b/contrib/spellchecker/src/java/org/apache/lucene/search/spell/SpellChecker.javaindex 67cdf761a14..d5633b9c144 100755--- a/contrib/spellchecker/src/java/org/apache/lucene/search/spell/SpellChecker.java+++ b/contrib/spellchecker/src/java/org/apache/lucene/search/spell/SpellChecker.java@@ -349,14 +349,14 @@ public class SpellChecker {String end = null;for (int i = 0; i < len - ng + 1; i++) {String gram = text.substring(i, i + ng);- doc.add(new Field(key, gram, Field.Store.YES, Field.Index.UN_TOKENIZED));+ doc.add(new Field(key, gram, Field.Store.NO, Field.Index.UN_TOKENIZED));if (i == 0) {- doc.add(new Field("start" + ng, gram, Field.Store.YES, Field.Index.UN_TOKENIZED));+ doc.add(new Field("start" + ng, gram, Field.Store.NO, Field.Index.UN_TOKENIZED));}end = gram;}if (end != null) { // may not be present if len==ng1- doc.add(new Field("end" + ng, end, Field.Store.YES, Field.Index.UN_TOKENIZED));+ doc.add(new Field("end" + ng, end, Field.Store.NO, Field.Index.UN_TOKENIZED));}}}