fix NumericTokenStream example to use TextField type: IntField is not correct here.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1384038 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2012-09-12 17:06:18 +00:00
parent 647b509169
commit aed9e0f350
1 changed files with 8 additions and 2 deletions

View File

@ -48,7 +48,10 @@ import org.apache.lucene.util.NumericUtils;
* <p>Here's an example usage, for an <code>int</code> field:
*
* <pre class="prettyprint">
* Field field = new Field(name, new NumericTokenStream(precisionStep).setIntValue(value), IntField.TYPE_NOT_STORED);
* FieldType fieldType = new FieldType(TextField.TYPE_NOT_STORED);
* fieldType.setOmitNorms(true);
* fieldType.setIndexOptions(IndexOptions.DOCS_ONLY);
* Field field = new Field(name, new NumericTokenStream(precisionStep).setIntValue(value), fieldType);
* document.add(field);
* </pre>
*
@ -57,7 +60,10 @@ import org.apache.lucene.util.NumericUtils;
*
* <pre class="prettyprint">
* NumericTokenStream stream = new NumericTokenStream(precisionStep);
* Field field = new Field(name, stream, IntField.TYPE_NOT_STORED);
* FieldType fieldType = new FieldType(TextField.TYPE_NOT_STORED);
* fieldType.setOmitNorms(true);
* fieldType.setIndexOptions(IndexOptions.DOCS_ONLY);
* Field field = new Field(name, stream, fieldType);
* Document document = new Document();
* document.add(field);
*