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:
Daniel Naber 2004-09-01 20:04:12 +00:00
parent 8f99bfef89
commit 794ba80e15
1 changed files with 10 additions and 3 deletions

View File

@ -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;