LUCENE-963: added caveats to javadocs for new Field setValue(...) methods

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@557553 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2007-07-19 10:16:30 +00:00
parent 66bacd0b13
commit a3298ce85c
2 changed files with 21 additions and 12 deletions

View File

@ -18,6 +18,10 @@ API Changes
2. LUCENE-944: Remove deprecated methods setUseScorer14() and
getUseScorer14() from BooleanQuery. (Paul Elschot via Michael Busch)
5. LUCENE-963: Add setters to Field to allow for re-using a single
Field instance during indexing. This is a sizable performance
gain, especially for small documents. (Mike McCandless)
Bug fixes
1. LUCENE-933: QueryParser fixed to not produce empty sub

View File

@ -156,30 +156,35 @@ public final class Field extends AbstractField implements Fieldable, Serializabl
public TokenStream tokenStreamValue() { return fieldsData instanceof TokenStream ? (TokenStream)fieldsData : null; }
/** Expert: change the value of this field. This can be
* used during indexing to re-use a single Field instance
* to improve indexing speed. */
/** <p>Expert: change the value of this field. This can
* be used during indexing to re-use a single Field
* instance to improve indexing speed by avoiding GC cost
* of new'ing and reclaiming Field instances. Typically
* a single {@link Document} instance is re-used as
* well. This helps most on small documents.</p>
*
* <p>Note that you should only use this method after the
* Field has been consumed (ie, the {@link Document}
* containing this Field has been added to the index).
* Also, each Field instance should only be used once
* within a single {@link Document} instance. See <a
* href="http://wiki.apache.org/lucene-java/ImproveIndexingSpeed">ImproveIndexingSpeed</a>
* for details.</p> */
public void setValue(String value) {
fieldsData = value;
}
/** Expert: change the value of this field. This can be
* used during indexing to re-use a single Field instance
* to improve indexing speed. */
/** Expert: change the value of this field. See <a href="#setValue(java.lang.String)">setValue(String)</a>. */
public void setValue(Reader value) {
fieldsData = value;
}
/** Expert: change the value of this field. This can be
* used during indexing to re-use a single Field instance
* to improve indexing speed. */
/** Expert: change the value of this field. See <a href="#setValue(java.lang.String)">setValue(String)</a>. */
public void setValue(byte[] value) {
fieldsData = value;
}
/** Expert: change the value of this field. This can be
* used during indexing to re-use a single Field instance
* to improve indexing speed. */
/** Expert: change the value of this field. See <a href="#setValue(java.lang.String)">setValue(String)</a>. */
public void setValue(TokenStream value) {
fieldsData = value;
}