From 52acd10f638c01a7c104f5e78be5546b2fbd30db Mon Sep 17 00:00:00 2001 From: Daniel Naber Date: Sat, 19 May 2007 11:04:38 +0000 Subject: [PATCH] LUCENE-882: Spellchecker doesn't need to store ngrams git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@539727 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES.txt | 6 +++++- .../java/org/apache/lucene/search/spell/SpellChecker.java | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index c39fd07253d..bfe12d63fcd 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -166,7 +166,11 @@ Optimizations TestBoolean2 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 with diff --git a/contrib/spellchecker/src/java/org/apache/lucene/search/spell/SpellChecker.java b/contrib/spellchecker/src/java/org/apache/lucene/search/spell/SpellChecker.java index 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)); } } }