You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2012/01/29 16:17:43 UTC
svn commit: r1237313 -
/lucene/dev/branches/lucene2858/modules/suggest/src/java/org/apache/lucene/search/spell/SpellChecker.java
Author: rmuir
Date: Sun Jan 29 15:17:43 2012
New Revision: 1237313
URL: http://svn.apache.org/viewvc?rev=1237313&view=rev
Log:
LUCENE-2858: fix spellchecker
Modified:
lucene/dev/branches/lucene2858/modules/suggest/src/java/org/apache/lucene/search/spell/SpellChecker.java
Modified: lucene/dev/branches/lucene2858/modules/suggest/src/java/org/apache/lucene/search/spell/SpellChecker.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene2858/modules/suggest/src/java/org/apache/lucene/search/spell/SpellChecker.java?rev=1237313&r1=1237312&r2=1237313&view=diff
==============================================================================
--- lucene/dev/branches/lucene2858/modules/suggest/src/java/org/apache/lucene/search/spell/SpellChecker.java (original)
+++ lucene/dev/branches/lucene2858/modules/suggest/src/java/org/apache/lucene/search/spell/SpellChecker.java Sun Jan 29 15:17:43 2012
@@ -28,6 +28,8 @@ import org.apache.lucene.document.Field;
import org.apache.lucene.document.FieldType;
import org.apache.lucene.index.FieldInfo.IndexOptions;
import org.apache.lucene.document.StringField;
+import org.apache.lucene.index.AtomicIndexReader;
+import org.apache.lucene.index.DirectoryReader;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.index.IndexWriterConfig;
@@ -166,7 +168,7 @@ public class SpellChecker implements jav
// modifications to the directory should be synchronized
synchronized (modifyCurrentIndexLock) {
ensureOpen();
- if (!IndexReader.indexExists(spellIndexDir)) {
+ if (!DirectoryReader.indexExists(spellIndexDir)) {
IndexWriter writer = new IndexWriter(spellIndexDir,
new IndexWriterConfig(Version.LUCENE_CURRENT,
null));
@@ -497,7 +499,7 @@ public class SpellChecker implements jav
if (reader.maxDoc() > 0) {
new ReaderUtil.Gather(reader) {
@Override
- protected void add(int base, IndexReader r) throws IOException {
+ protected void add(int base, AtomicIndexReader r) throws IOException {
Terms terms = r.terms(F_WORD);
if (terms != null)
termsEnums.add(terms.iterator(null));