From 794ba80e1570b3c945a959641cbfee156eef7999 Mon Sep 17 00:00:00 2001 From: Daniel Naber Date: Wed, 1 Sep 2004 20:04:12 +0000 Subject: [PATCH] stop using the deprecated Field constructor git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@150471 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/lucene/index/FieldsReader.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/java/org/apache/lucene/index/FieldsReader.java b/src/java/org/apache/lucene/index/FieldsReader.java index 025ff038f0a..145c4c96b0e 100644 --- a/src/java/org/apache/lucene/index/FieldsReader.java +++ b/src/java/org/apache/lucene/index/FieldsReader.java @@ -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;