lucene 4: use field type in UidField

This commit is contained in:
Shay Banon 2012-11-02 11:07:44 +01:00
parent faf3e0e857
commit dca88a9b7c
2 changed files with 2 additions and 4 deletions

View File

@ -30,6 +30,7 @@ import org.apache.lucene.search.DocIdSetIterator;
import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.BytesRef;
import org.elasticsearch.common.Numbers; import org.elasticsearch.common.Numbers;
import org.elasticsearch.common.lucene.Lucene; import org.elasticsearch.common.lucene.Lucene;
import org.elasticsearch.index.mapper.internal.UidFieldMapper;
import java.io.IOException; import java.io.IOException;
import java.io.Reader; import java.io.Reader;
@ -119,10 +120,9 @@ public class UidField extends Field {
private final UidPayloadTokenStream tokenStream; private final UidPayloadTokenStream tokenStream;
public UidField(String name, String uid, long version) { public UidField(String name, String uid, long version) {
super(name, uid, Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.NO); super(name, uid, UidFieldMapper.Defaults.UID_FIELD_TYPE);
this.uid = uid; this.uid = uid;
this.version = version; this.version = version;
// this.indexOptions = FieldInfo.IndexOptions.DOCS_AND_FREQS_AND_POSITIONS;
this.tokenStream = new UidPayloadTokenStream(this); this.tokenStream = new UidPayloadTokenStream(this);
} }

View File

@ -41,8 +41,6 @@ public class UidFieldMapper extends AbstractFieldMapper<Uid> implements Internal
public static final String NAME = "_uid".intern(); public static final String NAME = "_uid".intern();
public static final Term TERM_FACTORY = new Term(NAME, "");
public static final String CONTENT_TYPE = "_uid"; public static final String CONTENT_TYPE = "_uid";
public static class Defaults extends AbstractFieldMapper.Defaults { public static class Defaults extends AbstractFieldMapper.Defaults {