You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Robert Muir (JIRA)" <ji...@apache.org> on 2013/08/08 07:50:48 UTC

[jira] [Commented] (LUCENE-5158) Allow StoredFieldVisitor instances to be stateful

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

Robert Muir commented on LUCENE-5158:
-------------------------------------

{quote}
Unfortunately we have very large indexes, and rebuilding them to have the required field order is not an option.
{quote}

Then it can't work.

Lucene returns the order of the fields in A,B,A if you add fields in that order.

Separately if you want a reset() method to call before a document is processed, just add it to your own StoredFieldVisitor, and just call it yourself before the next ir.document().

Its not necessary to add this method to the lucene API for that.
                
> Allow StoredFieldVisitor instances to be stateful
> -------------------------------------------------
>
>                 Key: LUCENE-5158
>                 URL: https://issues.apache.org/jira/browse/LUCENE-5158
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: core/index
>    Affects Versions: 4.4
>            Reporter: Brendan Humphreys
>            Priority: Minor
>         Attachments: LUCENE-5158.patch
>
>
> Currently there is no way to build stateful {{StoredFieldVisitor}} s. 
> h3. Motivation
> We would like to optimise our access to stored fields in our indexes by utilising the {{StoredFieldVisitor.Status.STOP}} feature to stop processing fields in a document. Unfortunately we have very large indexes, and rebuilding them to have the required field order is not an option.
> A stateful {{StoredFieldVisitor}} could solve this; it could track which fields have been loaded for a document, and then {{STOP}} when the fields required have been loaded, regardless of the order they were loaded.
> h3. Implementation
> I've added a no-op {{public void reset()}} method to the {{StoredFieldVisitor}} base class, which gives a {{StoredFieldVisitor}} subclass an opportunity to reset its state before the fields of the next document are processed. I've added a call to {{reset()}} in all places the {{StoredFieldVisitor}} was being used.
>  
>  

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