Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

LUCENE-1961: Remove remaining deprecations from document package.

Michael Busch84b2c6ecaa5a
diff --git a/CHANGES.txt b/CHANGES.txt
index a521d8bdede..aa061af3eaf 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -36,6 +36,9 @@ API Changes
* LUCENE-1960: Remove deprecated Field.Store.COMPRESS. (Michael Busch)
+* LUCENE-1961: Remove remaining deprecations from document package.
+ (Michael Busch)
+
Bug fixes
New features
diff --git a/contrib/queryparser/src/test/org/apache/lucene/queryParser/standard/TestQPHelper.java b/contrib/queryparser/src/test/org/apache/lucene/queryParser/standard/TestQPHelper.java
index bfa91217ac5..c7bb1549e9e 100644
--- a/contrib/queryparser/src/test/org/apache/lucene/queryParser/standard/TestQPHelper.java
+++ b/contrib/queryparser/src/test/org/apache/lucene/queryParser/standard/TestQPHelper.java
@@ -595,7 +595,7 @@ public class TestQPHelper extends LocalizedTestCase {
IndexWriter.MaxFieldLength.LIMITED);
Document doc = new Document();
doc.add(new Field("content", "\u0633\u0627\u0628", Field.Store.YES,
- Field.Index.UN_TOKENIZED));
+ Field.Index.NOT_ANALYZED));
iw.addDocument(doc);
iw.close();
IndexSearcher is = new IndexSearcher(ramDir, true);
diff --git a/contrib/queryparser/src/test/org/apache/lucene/queryParser/standard/TestQueryParserWrapper.java b/contrib/queryparser/src/test/org/apache/lucene/queryParser/standard/TestQueryParserWrapper.java
index f5e061ed533..0427930dc2d 100644
--- a/contrib/queryparser/src/test/org/apache/lucene/queryParser/standard/TestQueryParserWrapper.java
+++ b/contrib/queryparser/src/test/org/apache/lucene/queryParser/standard/TestQueryParserWrapper.java
@@ -591,7 +591,7 @@ public class TestQueryParserWrapper extends LocalizedTestCase {
IndexWriter.MaxFieldLength.LIMITED);
Document doc = new Document();
doc.add(new Field("content", "\u0633\u0627\u0628", Field.Store.YES,
- Field.Index.UN_TOKENIZED));
+ Field.Index.NOT_ANALYZED));
iw.addDocument(doc);
iw.close();
IndexSearcher is = new IndexSearcher(ramDir, true);
diff --git a/contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestCartesian.java b/contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestCartesian.java
index 3d442001d4e..b64c73d58da 100644
--- a/contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestCartesian.java
+++ b/contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestCartesian.java
@@ -96,14 +96,14 @@ public class TestCartesian extends TestCase{
Document doc = new Document();
- doc.add(new Field("name", name,Field.Store.YES, Field.Index.TOKENIZED));
+ doc.add(new Field("name", name,Field.Store.YES, Field.Index.ANALYZED));
// convert the lat / long to lucene fields
- doc.add(new Field(latField, NumericUtils.doubleToPrefixCoded(lat),Field.Store.YES, Field.Index.UN_TOKENIZED));
- doc.add(new Field(lngField, NumericUtils.doubleToPrefixCoded(lng),Field.Store.YES, Field.Index.UN_TOKENIZED));
+ doc.add(new Field(latField, NumericUtils.doubleToPrefixCoded(lat),Field.Store.YES, Field.Index.NOT_ANALYZED));
+ doc.add(new Field(lngField, NumericUtils.doubleToPrefixCoded(lng),Field.Store.YES, Field.Index.NOT_ANALYZED));
// add a default meta field to make searching all documents easy
- doc.add(new Field("metafile", "doc",Field.Store.YES, Field.Index.TOKENIZED));
+ doc.add(new Field("metafile", "doc",Field.Store.YES, Field.Index.ANALYZED));
int ctpsize = ctps.size();
for (int i =0; i < ctpsize; i++){
@@ -111,11 +111,11 @@ public class TestCartesian extends TestCase{
doc.add(new Field(ctp.getTierFieldName(),
NumericUtils.doubleToPrefixCoded(ctp.getTierBoxId(lat,lng)),
Field.Store.YES,
- Field.Index.NO_NORMS));
+ Field.Index.NOT_ANALYZED_NO_NORMS));
doc.add(new Field(geoHashPrefix, GeoHashUtils.encode(lat,lng),
Field.Store.YES,
- Field.Index.NO_NORMS));
+ Field.Index.NOT_ANALYZED_NO_NORMS));
}
writer.addDocument(doc);
diff --git a/contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestDistance.java b/contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestDistance.java
index a1b919b21c7..920030796c8 100644
--- a/contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestDistance.java
+++ b/contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestDistance.java
@@ -63,14 +63,14 @@ public class TestDistance extends TestCase{
Document doc = new Document();
- doc.add(new Field("name", name,Field.Store.YES, Field.Index.TOKENIZED));
+ doc.add(new Field("name", name,Field.Store.YES, Field.Index.ANALYZED));
// convert the lat / long to lucene fields
- doc.add(new Field(latField, NumericUtils.doubleToPrefixCoded(lat),Field.Store.YES, Field.Index.UN_TOKENIZED));
- doc.add(new Field(lngField, NumericUtils.doubleToPrefixCoded(lng),Field.Store.YES, Field.Index.UN_TOKENIZED));
+ doc.add(new Field(latField, NumericUtils.doubleToPrefixCoded(lat),Field.Store.YES, Field.Index.NOT_ANALYZED));
+ doc.add(new Field(lngField, NumericUtils.doubleToPrefixCoded(lng),Field.Store.YES, Field.Index.NOT_ANALYZED));
// add a default meta field to make searching all documents easy
- doc.add(new Field("metafile", "doc",Field.Store.YES, Field.Index.TOKENIZED));
+ doc.add(new Field("metafile", "doc",Field.Store.YES, Field.Index.ANALYZED));
writer.addDocument(doc);
}
diff --git a/src/java/org/apache/lucene/document/AbstractField.java b/src/java/org/apache/lucene/document/AbstractField.java
index c5dc141bdc0..997452c426a 100755
--- a/src/java/org/apache/lucene/document/AbstractField.java
+++ b/src/java/org/apache/lucene/document/AbstractField.java
@@ -257,9 +257,6 @@ public abstract class AbstractField implements Fieldable {
/** True if norms are omitted for this indexed field */
public boolean getOmitNorms() { return omitNorms; }
- /** @deprecated Renamed to {@link #getOmitTermFreqAndPositions} */
- public boolean getOmitTf() { return omitTermFreqAndPositions; }
-
/** @see #setOmitTermFreqAndPositions */
public boolean getOmitTermFreqAndPositions() { return omitTermFreqAndPositions; }
@@ -270,9 +267,6 @@ public abstract class AbstractField implements Fieldable {
*/
public void setOmitNorms(boolean omitNorms) { this.omitNorms=omitNorms; }
- /** @deprecated Renamed to {@link #setOmitTermFreqAndPositions} */
- public void setOmitTf(boolean omitTermFreqAndPositions) { this.omitTermFreqAndPositions=omitTermFreqAndPositions; }
-
/** Expert:
*
* If set, omit term freq, positions and payloads from
diff --git a/src/java/org/apache/lucene/document/Document.java b/src/java/org/apache/lucene/document/Document.java
index a2b93c28f83..8c5a8fe2bf6 100644
--- a/src/java/org/apache/lucene/document/Document.java
+++ b/src/java/org/apache/lucene/document/Document.java
@@ -164,21 +164,6 @@ public final class Document implements java.io.Serializable {
return null;
}
- /** Returns an Enumeration of all the fields in a document.
- * @deprecated use {@link #getFields()} instead
- */
- public final Enumeration<Fieldable> fields() {
- return new Enumeration<Fieldable>() {
- final Iterator<Fieldable> iter = fields.iterator();
- public boolean hasMoreElements() {
- return iter.hasNext();
- }
- public Fieldable nextElement() {
- return iter.next();
- }
- };
- }
-
/** Returns a List of all the fields in a document.
* <p>Note that fields which are <i>not</i> {@link Fieldable#isStored() stored} are
* <i>not</i> available in documents retrieved from the
@@ -277,7 +262,7 @@ public final class Document implements java.io.Serializable {
List<byte[]> result = new ArrayList<byte[]>();
for (Fieldable field : fields) {
if (field.name().equals(name) && (field.isBinary()))
- result.add(field.binaryValue());
+ result.add(field.getBinaryValue());
}
if (result.size() == 0)
@@ -298,7 +283,7 @@ public final class Document implements java.io.Serializable {
public final byte[] getBinaryValue(String name) {
for (Fieldable field : fields) {
if (field.name().equals(name) && (field.isBinary()))
- return field.binaryValue();
+ return field.getBinaryValue();
}
return null;
}
diff --git a/src/java/org/apache/lucene/document/Field.java b/src/java/org/apache/lucene/document/Field.java
index 5d328bda597..96f93b1f26d 100644
--- a/src/java/org/apache/lucene/document/Field.java
+++ b/src/java/org/apache/lucene/document/Field.java
@@ -70,18 +70,12 @@ public final class Field extends AbstractField implements Fieldable, Serializabl
* common text. */
public static final Index ANALYZED = new Index("ANALYZED");
- /** @deprecated this has been renamed to {@link #ANALYZED} */
- public static final Index TOKENIZED = ANALYZED;
-
/** Index the field's value without using an Analyzer, so it can be searched.
* As no analyzer is used the value will be stored as a single term. This is
* useful for unique Ids like product numbers.
*/
public static final Index NOT_ANALYZED = new Index("NOT_ANALYZED");
- /** @deprecated This has been renamed to {@link #NOT_ANALYZED} */
- public static final Index UN_TOKENIZED = NOT_ANALYZED;
-
/** Expert: Index the field's value without an Analyzer,
* and also disable the storing of norms. Note that you
* can also separately enable/disable norms by calling
@@ -98,10 +92,6 @@ public final class Field extends AbstractField implements Fieldable, Serializabl
* from the beginning. */
public static final Index NOT_ANALYZED_NO_NORMS = new Index("NOT_ANALYZED_NO_NORMS");
- /** @deprecated This has been renamed to
- * {@link #NOT_ANALYZED_NO_NORMS} */
- public static final Index NO_NORMS = NOT_ANALYZED_NO_NORMS;
-
/** Expert: Index the tokens produced by running the
* field's value through an Analyzer, and also
* separately disable the storing of norms. See
@@ -159,29 +149,7 @@ public final class Field extends AbstractField implements Fieldable, Serializabl
* binary value is used. Exactly one of stringValue(),
* readerValue(), and getBinaryValue() must be set. */
public Reader readerValue() { return fieldsData instanceof Reader ? (Reader)fieldsData : null; }
-
- /** The value of the field in Binary, or null. If null, the Reader value,
- * or String value is used. Exactly one of stringValue(),
- * readerValue(), and getBinaryValue() must be set.
- * @deprecated This method must allocate a new byte[] if
- * the {@link AbstractField#getBinaryOffset()} is non-zero
- * or {@link AbstractField#getBinaryLength()} is not the
- * full length of the byte[]. Please use {@link
- * AbstractField#getBinaryValue()} instead, which simply
- * returns the byte[].
- */
- public byte[] binaryValue() {
- if (!isBinary)
- return null;
- final byte[] data = (byte[]) fieldsData;
- if (binaryOffset == 0 && data.length == binaryLength)
- return data; //Optimization
- final byte[] ret = new byte[binaryLength];
- System.arraycopy(data, binaryOffset, ret, 0, binaryLength);
- return ret;
- }
-
/** The TokesStream for this field to be used when indexing, or null. If null, the Reader value
* or String value is analyzed to produce the indexed tokens. */
public TokenStream tokenStreamValue() { return tokenStream; }
@@ -236,22 +204,8 @@ public final class Field extends AbstractField implements Fieldable, Serializabl
binaryOffset = offset;
}
-
- /** Expert: change the value of this field. See <a href="#setValue(java.lang.String)">setValue(String)</a>.
- * @deprecated use {@link #setTokenStream} */
- public void setValue(TokenStream value) {
- if (isBinary) {
- throw new IllegalArgumentException("cannot set a TokenStream value on a binary field");
- }
- if (isStored) {
- throw new IllegalArgumentException("cannot set a TokenStream value on a stored field");
- }
- fieldsData = null;
- tokenStream = value;
- }
-
/** Expert: sets the token stream to be used for indexing and causes isIndexed() and isTokenized() to return true.
- * May be combined with stored values from stringValue() or binaryValue() */
+ * May be combined with stored values from stringValue() or getBinaryValue() */
public void setTokenStream(TokenStream tokenStream) {
this.isIndexed = true;
this.isTokenized = true;
diff --git a/src/java/org/apache/lucene/document/Fieldable.java b/src/java/org/apache/lucene/document/Fieldable.java
index 043840a0eac..ee1dff9784b 100755
--- a/src/java/org/apache/lucene/document/Fieldable.java
+++ b/src/java/org/apache/lucene/document/Fieldable.java
@@ -18,6 +18,8 @@ package org.apache.lucene.document;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.index.FieldInvertState; // for javadocs
+import org.apache.lucene.search.PhraseQuery;
+import org.apache.lucene.search.spans.SpanQuery;
import java.io.Reader;
import java.io.Serializable;
@@ -77,7 +79,7 @@ public interface Fieldable extends Serializable {
/** The value of the field as a String, or null.
* <p>
* For indexing, if isStored()==true, the stringValue() will be used as the stored field value
- * unless isBinary()==true, in which case binaryValue() will be used.
+ * unless isBinary()==true, in which case getBinaryValue() will be used.
*
* If isIndexed()==true and isTokenized()==false, this String value will be indexed as a single token.
* If isIndexed()==true and isTokenized()==true, then tokenStreamValue() will be used to generate indexed tokens if not null,
@@ -90,11 +92,6 @@ public interface Fieldable extends Serializable {
*/
public Reader readerValue();
- /** The value of the field in Binary, or null.
- * @see #stringValue()
- */
- public byte[] binaryValue();
-
/** The TokenStream for this field to be used when indexing, or null.
* @see #stringValue()
*/
@@ -147,15 +144,9 @@ public interface Fieldable extends Serializable {
*/
void setOmitNorms(boolean omitNorms);
- /** @deprecated Renamed to {@link AbstractField#setOmitTermFreqAndPositions} */
- void setOmitTf(boolean omitTf);
-
- /** @deprecated Renamed to {@link AbstractField#getOmitTermFreqAndPositions} */
- boolean getOmitTf();
-
/**
* Indicates whether a Field is Lazy or not. The semantics of Lazy loading are such that if a Field is lazily loaded, retrieving
- * it's values via {@link #stringValue()} or {@link #binaryValue()} is only valid as long as the {@link org.apache.lucene.index.IndexReader} that
+ * it's values via {@link #stringValue()} or {@link #getBinaryValue()} is only valid as long as the {@link org.apache.lucene.index.IndexReader} that
* retrieved the {@link Document} is still open.
*
* @return true if this field can be loaded lazily
@@ -193,7 +184,7 @@ public interface Fieldable extends Serializable {
* About reuse: if you pass in the result byte[] and it is
* used, likely the underlying implementation will hold
* onto this byte[] and return it in future calls to
- * {@link #binaryValue()} or {@link #getBinaryValue()}.
+ * {@link #getBinaryValue()}.
* So if you subsequently re-use the same byte[] elsewhere
* it will alter this Fieldable's value.
* @param result User defined buffer that will be used if
@@ -202,4 +193,20 @@ public interface Fieldable extends Serializable {
* @return reference to the Field value as byte[].
*/
abstract byte[] getBinaryValue(byte[] result);
+
+ /** @see #setOmitTermFreqAndPositions */
+ boolean getOmitTermFreqAndPositions();
+
+ /** Expert:
+ *
+ * If set, omit term freq, positions and payloads from
+ * postings for this field.
+ *
+ * <p><b>NOTE</b>: While this option reduces storage space
+ * required in the index, it also means any query
+ * requiring positional information, such as {@link
+ * PhraseQuery} or {@link SpanQuery} subclasses will
+ * silently fail to find results.
+ */
+ void setOmitTermFreqAndPositions(boolean omitTermFreqAndPositions);
}
diff --git a/src/java/org/apache/lucene/document/NumericField.java b/src/java/org/apache/lucene/document/NumericField.java
index 782c3af104e..5ce8f924f13 100644
--- a/src/java/org/apache/lucene/document/NumericField.java
+++ b/src/java/org/apache/lucene/document/NumericField.java
@@ -206,11 +206,6 @@ public final class NumericField extends AbstractField {
return isIndexed() ? tokenStream : null;
}
- /** Returns always <code>null</code> for numeric fields */
- public byte[] binaryValue() {
- return null;
- }
-
/** Returns always <code>null</code> for numeric fields */
@Override
public byte[] getBinaryValue(byte[] result){
diff --git a/src/java/org/apache/lucene/index/DocFieldProcessorPerThread.java b/src/java/org/apache/lucene/index/DocFieldProcessorPerThread.java
index b10ac28ee58..301dab51e22 100644
--- a/src/java/org/apache/lucene/index/DocFieldProcessorPerThread.java
+++ b/src/java/org/apache/lucene/index/DocFieldProcessorPerThread.java
@@ -190,7 +190,7 @@ final class DocFieldProcessorPerThread extends DocConsumerPerThread {
// easily add it
FieldInfo fi = fieldInfos.add(fieldName, field.isIndexed(), field.isTermVectorStored(),
field.isStorePositionWithTermVector(), field.isStoreOffsetWithTermVector(),
- field.getOmitNorms(), false, field.getOmitTf());
+ field.getOmitNorms(), false, field.getOmitTermFreqAndPositions());
fp = new DocFieldProcessorPerField(this, fi);
fp.next = fieldHash[hashPos];
@@ -202,7 +202,7 @@ final class DocFieldProcessorPerThread extends DocConsumerPerThread {
} else
fp.fieldInfo.update(field.isIndexed(), field.isTermVectorStored(),
field.isStorePositionWithTermVector(), field.isStoreOffsetWithTermVector(),
- field.getOmitNorms(), false, field.getOmitTf());
+ field.getOmitNorms(), false, field.getOmitTermFreqAndPositions());
if (thisFieldGen != fp.lastGen) {
diff --git a/src/java/org/apache/lucene/index/FieldInfos.java b/src/java/org/apache/lucene/index/FieldInfos.java
index 27c94a5c0e7..7335060b335 100644
--- a/src/java/org/apache/lucene/index/FieldInfos.java
+++ b/src/java/org/apache/lucene/index/FieldInfos.java
@@ -116,7 +116,7 @@ final class FieldInfos {
while (fieldIterator.hasNext()) {
Fieldable field = (Fieldable) fieldIterator.next();
add(field.name(), field.isIndexed(), field.isTermVectorStored(), field.isStorePositionWithTermVector(),
- field.isStoreOffsetWithTermVector(), field.getOmitNorms(), false, field.getOmitTf());
+ field.isStoreOffsetWithTermVector(), field.getOmitNorms(), false, field.getOmitTermFreqAndPositions());
}
}
diff --git a/src/java/org/apache/lucene/index/FieldsReader.java b/src/java/org/apache/lucene/index/FieldsReader.java
index 7d0bf6ba576..5f6896d14db 100644
--- a/src/java/org/apache/lucene/index/FieldsReader.java
+++ b/src/java/org/apache/lucene/index/FieldsReader.java
@@ -425,16 +425,9 @@ final class FieldsReader implements Cloneable {
return localFieldsStream;
}
- /** The value of the field in Binary, or null. If null, the Reader value,
- * String value, or TokenStream value is used. Exactly one of stringValue(),
- * readerValue(), binaryValue(), and tokenStreamValue() must be set. */
- public byte[] binaryValue() {
- return getBinaryValue(null);
- }
-
/** The value of the field as a Reader, or null. If null, the String value,
* binary value, or TokenStream value is used. Exactly one of stringValue(),
- * readerValue(), binaryValue(), and tokenStreamValue() must be set. */
+ * readerValue(), getBinaryValue(), and tokenStreamValue() must be set. */
public Reader readerValue() {
ensureOpen();
return null;
@@ -442,7 +435,7 @@ final class FieldsReader implements Cloneable {
/** The value of the field as a TokenStream, or null. If null, the Reader value,
* String value, or binary value is used. Exactly one of stringValue(),
- * readerValue(), binaryValue(), and tokenStreamValue() must be set. */
+ * readerValue(), getBinaryValue(), and tokenStreamValue() must be set. */
public TokenStream tokenStreamValue() {
ensureOpen();
return null;
@@ -450,7 +443,7 @@ final class FieldsReader implements Cloneable {
/** The value of the field as a String, or null. If null, the Reader value,
* binary value, or TokenStream value is used. Exactly one of stringValue(),
- * readerValue(), binaryValue(), and tokenStreamValue() must be set. */
+ * readerValue(), getBinaryValue(), and tokenStreamValue() must be set. */
public String stringValue() {
ensureOpen();
if (isBinary)
diff --git a/src/test/org/apache/lucene/index/DocHelper.java b/src/test/org/apache/lucene/index/DocHelper.java
index d95a008f179..e9a899e58ad 100644
--- a/src/test/org/apache/lucene/index/DocHelper.java
+++ b/src/test/org/apache/lucene/index/DocHelper.java
@@ -169,7 +169,7 @@ class DocHelper {
if (f.isStored()) add(stored,f);
else add(unstored,f);
if (f.getOmitNorms()) add(noNorms,f);
- if (f.getOmitTf()) add(noTf,f);
+ if (f.getOmitTermFreqAndPositions()) add(noTf,f);
if (f.isLazy()) add(lazy, f);
}
}
diff --git a/src/test/org/apache/lucene/index/TestFieldsReader.java b/src/test/org/apache/lucene/index/TestFieldsReader.java
index b912ccc3200..3f5366338f9 100644
--- a/src/test/org/apache/lucene/index/TestFieldsReader.java
+++ b/src/test/org/apache/lucene/index/TestFieldsReader.java
@@ -72,7 +72,7 @@ public class TestFieldsReader extends LuceneTestCase {
assertTrue(field.isStoreOffsetWithTermVector() == true);
assertTrue(field.isStorePositionWithTermVector() == true);
assertTrue(field.getOmitNorms() == false);
- assertTrue(field.getOmitTf() == false);
+ assertTrue(field.getOmitTermFreqAndPositions() == false);
field = doc.getField(DocHelper.TEXT_FIELD_3_KEY);
assertTrue(field != null);
@@ -80,7 +80,7 @@ public class TestFieldsReader extends LuceneTestCase {
assertTrue(field.isStoreOffsetWithTermVector() == false);
assertTrue(field.isStorePositionWithTermVector() == false);
assertTrue(field.getOmitNorms() == true);
- assertTrue(field.getOmitTf() == false);
+ assertTrue(field.getOmitTermFreqAndPositions() == false);
field = doc.getField(DocHelper.NO_TF_KEY);
assertTrue(field != null);
@@ -88,7 +88,7 @@ public class TestFieldsReader extends LuceneTestCase {
assertTrue(field.isStoreOffsetWithTermVector() == false);
assertTrue(field.isStorePositionWithTermVector() == false);
assertTrue(field.getOmitNorms() == false);
- assertTrue(field.getOmitTf() == true);
+ assertTrue(field.getOmitTermFreqAndPositions() == true);
reader.close();
}
@@ -134,7 +134,7 @@ public class TestFieldsReader extends LuceneTestCase {
assertTrue("field is null and it shouldn't be", field != null);
assertTrue("stringValue isn't null for lazy binary field", field.stringValue() == null);
- byte [] bytes = field.binaryValue();
+ byte [] bytes = field.getBinaryValue();
assertTrue("bytes is null and it shouldn't be", bytes != null);
assertTrue("", DocHelper.LAZY_FIELD_BINARY_BYTES.length == bytes.length);
for (int i = 0; i < bytes.length; i++) {
@@ -286,9 +286,9 @@ public class TestFieldsReader extends LuceneTestCase {
assertTrue(f1.isBinary());
assertTrue(!f3.isBinary());
assertTrue(fb.isBinary());
- assertSizeEquals(2*DocHelper.FIELD_1_TEXT.length(), f1.binaryValue());
+ assertSizeEquals(2*DocHelper.FIELD_1_TEXT.length(), f1.getBinaryValue());
assertEquals(DocHelper.FIELD_3_TEXT, f3.stringValue());
- assertSizeEquals(DocHelper.LAZY_FIELD_BINARY_BYTES.length, fb.binaryValue());
+ assertSizeEquals(DocHelper.LAZY_FIELD_BINARY_BYTES.length, fb.getBinaryValue());
reader.close();
}
diff --git a/src/test/org/apache/lucene/queryParser/TestQueryParser.java b/src/test/org/apache/lucene/queryParser/TestQueryParser.java
index 9012f7836ba..51902a48618 100644
--- a/src/test/org/apache/lucene/queryParser/TestQueryParser.java
+++ b/src/test/org/apache/lucene/queryParser/TestQueryParser.java
@@ -467,7 +467,7 @@ public class TestQueryParser extends LocalizedTestCase {
IndexWriter.MaxFieldLength.LIMITED);
Document doc = new Document();
doc.add(new Field("content","\u0633\u0627\u0628",
- Field.Store.YES, Field.Index.UN_TOKENIZED));
+ Field.Store.YES, Field.Index.NOT_ANALYZED));
iw.addDocument(doc);
iw.close();
IndexSearcher is = new IndexSearcher(ramDir, true);
diff --git a/src/test/org/apache/lucene/search/TestMultiTermConstantScore.java b/src/test/org/apache/lucene/search/TestMultiTermConstantScore.java
index 6f766825c83..00626a3cdd2 100644
--- a/src/test/org/apache/lucene/search/TestMultiTermConstantScore.java
+++ b/src/test/org/apache/lucene/search/TestMultiTermConstantScore.java
@@ -660,9 +660,9 @@ public class TestMultiTermConstantScore extends BaseTestRangeFilter {
for (int docnum = 0 ; docnum < words.length ; ++docnum) {
Document doc = new Document();
doc.add(new Field("content", words[docnum],
- Field.Store.YES, Field.Index.UN_TOKENIZED));
+ Field.Store.YES, Field.Index.NOT_ANALYZED));
doc.add(new Field("body", "body",
- Field.Store.YES, Field.Index.UN_TOKENIZED));
+ Field.Store.YES, Field.Index.NOT_ANALYZED));
writer.addDocument(doc);
}
writer.optimize();
diff --git a/src/test/org/apache/lucene/search/TestTermRangeFilter.java b/src/test/org/apache/lucene/search/TestTermRangeFilter.java
index b543542d26b..e2ab5ce4b7b 100644
--- a/src/test/org/apache/lucene/search/TestTermRangeFilter.java
+++ b/src/test/org/apache/lucene/search/TestTermRangeFilter.java
@@ -343,9 +343,9 @@ public class TestTermRangeFilter extends BaseTestRangeFilter {
IndexWriter.MaxFieldLength.LIMITED);
Document doc = new Document();
doc.add(new Field("content","\u0633\u0627\u0628",
- Field.Store.YES, Field.Index.UN_TOKENIZED));
+ Field.Store.YES, Field.Index.NOT_ANALYZED));
doc.add(new Field("body", "body",
- Field.Store.YES, Field.Index.UN_TOKENIZED));
+ Field.Store.YES, Field.Index.NOT_ANALYZED));
writer.addDocument(doc);
writer.optimize();
@@ -387,9 +387,9 @@ public class TestTermRangeFilter extends BaseTestRangeFilter {
for (int docnum = 0 ; docnum < words.length ; ++docnum) {
Document doc = new Document();
doc.add(new Field("content", words[docnum],
- Field.Store.YES, Field.Index.UN_TOKENIZED));
+ Field.Store.YES, Field.Index.NOT_ANALYZED));
doc.add(new Field("body", "body",
- Field.Store.YES, Field.Index.UN_TOKENIZED));
+ Field.Store.YES, Field.Index.NOT_ANALYZED));
writer.addDocument(doc);
}
writer.optimize();
diff --git a/src/test/org/apache/lucene/search/spans/TestSpans.java b/src/test/org/apache/lucene/search/spans/TestSpans.java
index 9e8d57e9db3..6acff60bea3 100644
--- a/src/test/org/apache/lucene/search/spans/TestSpans.java
+++ b/src/test/org/apache/lucene/search/spans/TestSpans.java
@@ -421,8 +421,8 @@ public class TestSpans extends LuceneTestCase {
// LUCENE-1404
private void addDoc(IndexWriter writer, String id, String text) throws IOException {
final Document doc = new Document();
- doc.add( new Field("id", id, Field.Store.YES, Field.Index.UN_TOKENIZED) );
- doc.add( new Field("text", text, Field.Store.YES, Field.Index.TOKENIZED) );
+ doc.add( new Field("id", id, Field.Store.YES, Field.Index.NOT_ANALYZED) );
+ doc.add( new Field("text", text, Field.Store.YES, Field.Index.ANALYZED) );
writer.addDocument(doc);
}