LUCENE-1561: don't change Fieldable interface for the rename; add deprecated to AbstractField's omitTf methods

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@763354 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2009-04-08 19:17:56 +00:00
parent 9fc1c180b2
commit cb95e45419
4 changed files with 24 additions and 24 deletions

View File

@ -15,6 +15,9 @@ package org.apache.lucene.document;
* limitations under the License.
*/
import org.apache.lucene.search.PhraseQuery; // for javadocs
import org.apache.lucene.search.spans.SpanQuery; // for javadocs
/**
*
@ -263,8 +266,10 @@ 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; }
/** Expert:
@ -274,8 +279,20 @@ 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
* 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.
*/
public void setOmitTermFreqAndPositions(boolean omitTermFreqAndPositions) { this.omitTermFreqAndPositions=omitTermFreqAndPositions; }
public boolean isLazy() {

View File

@ -17,9 +17,7 @@ package org.apache.lucene.document;
*/
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.index.FieldInvertState;
import org.apache.lucene.search.PhraseQuery; // for javadocs
import org.apache.lucene.search.spans.SpanQuery; // for javadocs
import org.apache.lucene.index.FieldInvertState; // for javadocs
import java.io.Reader;
import java.io.Serializable;
@ -147,27 +145,12 @@ public interface Fieldable extends Serializable {
*/
void setOmitNorms(boolean omitNorms);
/** @deprecated Renamed to {@link #setOmitTermFreqAndPositions} */
/** @deprecated Renamed to {@link AbstractField#setOmitTermFreqAndPositions} */
void setOmitTf(boolean omitTf);
/** @deprecated Renamed to {@link #getOmitTermFreqAndPositions} */
/** @deprecated Renamed to {@link AbstractField#getOmitTermFreqAndPositions} */
boolean getOmitTf();
/** Expert:
*
* If set, omit term freq, positions and payloads from postings for this field.
* <p><b>NOTE</b>: this is a dangerous option to enable.
* While it reduces storage space required in the index,
* it also means any query requiring positional
* infromation, such as {@link PhraseQuery} or {@link
* SpanQuery} subclasses will silently fail to find
* results.
*/
void setOmitTermFreqAndPositions(boolean omitTermFreqAndPositions);
/** True if tf is omitted for this indexed field */
boolean getOmitTermFreqAndPositions();
/**
* 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

View File

@ -20,6 +20,7 @@ package org.apache.lucene.index;
import org.apache.lucene.store.FSDirectory;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.IndexInput;
import org.apache.lucene.document.AbstractField; // for javadocs
import org.apache.lucene.document.Document;
import java.text.NumberFormat;
@ -29,7 +30,6 @@ import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.ArrayList;
import org.apache.lucene.document.Fieldable; // for javadoc
/**
* Basic tool and API to check the health of an index and
@ -167,7 +167,7 @@ public class CheckIndex {
/** True if at least one of the fields in this segment
* does not omitTermFreqAndPositions.
* @see Fieldable#setOmitTermFreqAndPositions */
* @see AbstractField#setOmitTermFreqAndPositions */
public boolean hasProx;
}
}

View File

@ -183,7 +183,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.getOmitTermFreqAndPositions());
field.getOmitNorms(), false, field.getOmitTf());
fp = new DocFieldProcessorPerField(this, fi);
fp.next = fieldHash[hashPos];
@ -195,7 +195,7 @@ final class DocFieldProcessorPerThread extends DocConsumerPerThread {
} else
fp.fieldInfo.update(field.isIndexed(), field.isTermVectorStored(),
field.isStorePositionWithTermVector(), field.isStoreOffsetWithTermVector(),
field.getOmitNorms(), false, field.getOmitTermFreqAndPositions());
field.getOmitNorms(), false, field.getOmitTf());
if (thisFieldGen != fp.lastGen) {