You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Woody Anderson (JIRA)" <ji...@apache.org> on 2010/07/14 10:45:50 UTC

[jira] Updated: (LUCENE-2276) Add IndexReader.document(int, Document, FieldSelector)

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

Woody Anderson updated LUCENE-2276:
-----------------------------------

    Attachment: LUCENE-2276.patch

This patch adds the document(int,Document,FieldSelector) method to IndexReader.

I had the implementation call document(int,FieldSelector) and then copy the data into the provided document (if it's not null).
This is not as "good" as having document(int,FS) call document(int, null, FS), but, as all currently implemented Readers are only bound to implement document(int,FS), which is abstract, it seemed safest to leave that method abstract rather than introducing a new abstract method.

as such, subclasses can override document((int,doc,fs) for improved object reuse, as is done for SegmentReader and ParallelReader etc. where they allocate the Doc only if needed.

Unit tests included to validate expected "append to provided doc, if not null" documented behavior.

> Add IndexReader.document(int, Document, FieldSelector)
> ------------------------------------------------------
>
>                 Key: LUCENE-2276
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2276
>             Project: Lucene - Java
>          Issue Type: Wish
>          Components: Search
>            Reporter: Tim Smith
>         Attachments: LUCENE-2276.patch
>
>
> The Document object passed in would be populated with the fields identified by the FieldSelector for the specified internal document id
> This method would allow reuse of Document objects when retrieving stored fields from the index

-- 
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-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org