[ 
https://issues.apache.org/jira/browse/LUCENE-2544?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12913084#action_12913084
 ] 

Uwe Schindler commented on LUCENE-2544:
---------------------------------------

It is two field instances, but results only in one field in the index. Stored 
fields and indexed fields are handled separate by the indexer, so there is 
nothing different between a combined store/index and two separate Field 
instances (same field name!) with one is stored the other is indexed. If you 
want to store something different than you indexed, this is the way to go:
{code}
doc.add(new NumericField(name, Field.Store.NO, true).setIntValue(xxx/divisor));
doc.add(new NumericField(name, Field.Store.YES, false).setIntValue(xxx));
{code}

> Add 'divisor' to NumericField, allows for easy storage of full precision 
> data, but indexing *starting* at lower precision.
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-2544
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2544
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Other
>    Affects Versions: 3.0.2
>            Reporter: Woody Anderson
>            Priority: Minor
>             Fix For: 3.1, 4.0
>
>         Attachments: LUCENE-2544.patch
>
>
> In some cases, we want to index a timestamp or some other high precision 
> numeric at a much lower precision, but we still want to store the full 
> precision data.
> Rather than have to do this with two Field objects in the Document, it'd be 
> easier to provide NumericField with a divisor as well as prevision step. The 
> divisor would apply before beginning the trie logic.
> most often, this is a divide by 1, but that will happen only during the 
> constructor or setXXXValue() in NumericTokenStream.
> I have the patch for this, or i will after i isolate it.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to