mirror of https://github.com/apache/lucene.git
stop using the deprecated Field constructor
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@150471 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8f99bfef89
commit
794ba80e15
|
@ -67,11 +67,18 @@ final class FieldsReader {
|
|||
|
||||
byte bits = fieldsStream.readByte();
|
||||
|
||||
Field.Index index;
|
||||
boolean tokenize = (bits & 1) != 0;
|
||||
if (fi.isIndexed && tokenize)
|
||||
index = Field.Index.TOKENIZED;
|
||||
else if (fi.isIndexed && !tokenize)
|
||||
index = Field.Index.UN_TOKENIZED;
|
||||
else
|
||||
index = Field.Index.NO;
|
||||
doc.add(new Field(fi.name, // name
|
||||
fieldsStream.readString(), // read value
|
||||
true, // stored
|
||||
fi.isIndexed, // indexed
|
||||
(bits & 1) != 0, fi.storeTermVector)); // vector
|
||||
Field.Store.YES, index,
|
||||
fi.storeTermVector ? Field.TermVector.YES : Field.TermVector.NO));
|
||||
}
|
||||
|
||||
return doc;
|
||||
|
|
Loading…
Reference in New Issue