Add assert that fails one Elasticsearch upgrades to Lucene 4.3 in order to remove the duplicated class

This commit is contained in:
Simon Willnauer 2013-04-26 19:16:21 +02:00
parent 90353ceb79
commit 2ed2fab904
1 changed files with 6 additions and 1 deletions

View File

@ -30,10 +30,12 @@ import org.apache.lucene.util.BytesRefHash;
import org.apache.lucene.util.CharsRef;
import org.apache.lucene.util.IntsRef;
import org.apache.lucene.util.UnicodeUtil;
import org.apache.lucene.util.Version;
import org.apache.lucene.util.fst.ByteSequenceOutputs;
import org.apache.lucene.util.fst.FST;
import org.apache.lucene.util.fst.FST.Arc;
import org.apache.lucene.util.fst.FST.BytesReader;
import org.elasticsearch.common.lucene.Lucene;
/**
* Provides the ability to override any {@link KeywordAttribute} aware stemmer
@ -47,10 +49,13 @@ public final class XStemmerOverrideFilter extends TokenFilter {
private final KeywordAttribute keywordAtt = addAttribute(KeywordAttribute.class);
private final BytesReader fstReader;
private final Arc<BytesRef> scratchArc = new FST.Arc<BytesRef>();
;
private final CharsRef spare = new CharsRef();
private final boolean ignoreCase;
static {
assert Version.LUCENE_42 == Lucene.VERSION: "Elasticsearch has upgraded to Lucene Version: [" + Lucene.VERSION + "] this should can be removed";
}
/**
* Create a new StemmerOverrideFilter, performing dictionary-based stemming
* with the provided <code>dictionary</code>.