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

Brendan Humphreys commented on LUCENE-5158:
-------------------------------------------


bq. 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.

Yes, I see now what you mean. I had come to this solution via a fairly 
circuitous route; stopping to smell the flowers I see my modifications were 
unnecessary. I'll close this won't fix. 

Cheers,
-Brendan




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

Reply via email to