[ 
https://issues.apache.org/jira/browse/LUCENE-4359?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Robert Muir updated LUCENE-4359:
--------------------------------

    Attachment: LUCENE-4359_test.patch

just adding a test: i ran into another bug (i think i saw this on the issue 
tracker, will look) that confused me for a second, as my test initially passed 
with assertNull(document.get("dv")):

{noformat}
doc 0
  numfields 2
  field 1
    name dv
    type long
    value 0
  field 0
    name docId
    type string
    value 0
{noformat}

This second bug is in Document/StoredDocument for numeric fields:
{code}
   /** Returns the string value of the field with the given name if any exist in
    * this document, or null.  If multiple fields exist with this name, this
    * method returns the first value added. If only binary fields with this name
    * exist, returns null.
    * For {@link IntField}, {@link LongField}, {@link
    * FloatField} and {@link DoubleField} it returns the string value of the 
number. If you want
    * the actual numeric field instance back, use {@link #getField}.
    */
   public final String get(String name) {
     for (StorableField field : fields) {
       if (field.name().equals(name) && field.stringValue() != null) {
         return field.stringValue();
       }
     }
     return null;
   }
{code}

It clearly does not return the string value of a number for numeric fields. Ill 
separate this into another issue (or reuse the existing one if i find it)
                
> Allow DocValues to be unstored
> ------------------------------
>
>                 Key: LUCENE-4359
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4359
>             Project: Lucene - Core
>          Issue Type: Sub-task
>    Affects Versions: 5.0
>            Reporter: Adrien Grand
>         Attachments: LUCENE-4359_test.patch
>
>
> Lucene trunk currently forces DocValues to be stored:
>  - FieldType.setDocValueType sets stored to true,
>  - DocFieldProcessor.processDocument handles DocValues in a {{for 
> (StorableField field: docState.doc.storableFields())}} loop, meaning that 
> DocValues won't be consumed if they are not stored.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to