mirror of https://github.com/apache/lucene.git
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:
parent
a7872618f6
commit
a06dfd60d3
|
@ -30,47 +30,31 @@ import org.apache.lucene.util.BytesRef;
|
||||||
* <p>
|
* <p>
|
||||||
* This class provides a {@link Field} that enables storing of typed
|
* This class provides a {@link Field} that enables storing of typed
|
||||||
* per-document values for scoring, sorting or value retrieval. Here's an
|
* 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>
|
* <pre>
|
||||||
* DocValuesField field = new DocValuesField(name, DocValues.Type.VAR_INTS);
|
* document.add(new DocValuesField(name, 22, DocValues.Type.VAR_INTS));
|
||||||
* field.setInt(value);
|
|
||||||
* document.add(field);
|
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* For optimal performance, re-use the <code>DocValuesField</code> and
|
* For optimal performance, re-use the <code>DocValuesField</code> and
|
||||||
* {@link Document} instance for more than one document:
|
* {@link Document} instance for more than one document:
|
||||||
*
|
*
|
||||||
* <pre>
|
* <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 document = new Document();
|
||||||
* document.add(field);
|
* document.add(field);
|
||||||
*
|
*
|
||||||
* for(all documents) {
|
* for(all documents) {
|
||||||
* ...
|
* ...
|
||||||
* field.setInt(value)
|
* field.setValue(value)
|
||||||
* writer.addDocument(document);
|
* writer.addDocument(document);
|
||||||
* ...
|
* ...
|
||||||
* }
|
* }
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* <p>
|
* <p>
|
||||||
* If doc values are stored in addition to an indexed ({@link FieldType#setIndexed(boolean)}) or stored
|
* If you also need to store the value, you should add a
|
||||||
* ({@link FieldType#setStored(boolean)}) value it's recommended to pass the appropriate {@link FieldType}
|
* separate {@link StoredField} instance.
|
||||||
* 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>
|
|
||||||
*
|
|
||||||
* */
|
* */
|
||||||
|
|
||||||
public class DocValuesField extends Field {
|
public class DocValuesField extends Field {
|
||||||
|
|
Loading…
Reference in New Issue