fix javadocs (thanks rboulton)

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1238659 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2012-01-31 15:19:45 +00:00
parent a7872618f6
commit a06dfd60d3
1 changed files with 6 additions and 22 deletions

View File

@ -30,47 +30,31 @@ import org.apache.lucene.util.BytesRef;
* <p>
* This class provides a {@link Field} that enables storing of typed
* per-document values for scoring, sorting or value retrieval. Here's an
* example usage, adding an int value:
* example usage, adding an int value (<code>22</code>):
*
* <pre>
* DocValuesField field = new DocValuesField(name, DocValues.Type.VAR_INTS);
* field.setInt(value);
* document.add(field);
* document.add(new DocValuesField(name, 22, DocValues.Type.VAR_INTS));
* </pre>
*
* For optimal performance, re-use the <code>DocValuesField</code> and
* {@link Document} instance for more than one document:
*
* <pre>
* DocValuesField field = new DocValuesField(name, DocValues.Type.VAR_INTS);
* DocValuesField field = new DocValuesField(name, 0, DocValues.Type.VAR_INTS);
* Document document = new Document();
* document.add(field);
*
* for(all documents) {
* ...
* field.setInt(value)
* field.setValue(value)
* writer.addDocument(document);
* ...
* }
* </pre>
*
* <p>
* If doc values are stored in addition to an indexed ({@link FieldType#setIndexed(boolean)}) or stored
* ({@link FieldType#setStored(boolean)}) value it's recommended to pass the appropriate {@link FieldType}
* when creating the field:
*
* <pre>
* DocValuesField field = new DocValuesField(name, StringField.TYPE_STORED);
* Document document = new Document();
* document.add(field);
* for(all documents) {
* ...
* field.setInt(value)
* writer.addDocument(document);
* ...
* }
* </pre>
*
* If you also need to store the value, you should add a
* separate {@link StoredField} instance.
* */
public class DocValuesField extends Field {