[
https://issues.apache.org/jira/browse/LUCENE-3638?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13167120#comment-13167120
]
Robert Muir commented on LUCENE-3638:
-------------------------------------
{quote}
However, I do see the convenience of specifying just 1-2 fields that you don't
want to load, rather than 20 that you do. So how about you create a new
StoredFieldVisitor, which takes the list of fields 'not to load'? It can extend
DocumentStoredFieldVisitor by overriding needsField?
{quote}
DocumentStoredFieldsVisitor already supports this in its ctors.
So i would recommend we consider adding some sugar to indexreader:
{noformat}
public final Document document(int docID, Set<String> fields) {
return document(docid, new DocumentStoredFieldsVisitor(fields));
}
{noformat}
sure there are cases where you want more complicated logic like to return STOP
after certain fields, for that write your own logic.
But this is probably pretty common.
> IndexReader.document always return a doc with all the stored fields loaded.
> And this can be slow for the indexed document contain huge fields
> ---------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: LUCENE-3638
> URL: https://issues.apache.org/jira/browse/LUCENE-3638
> Project: Lucene - Java
> Issue Type: Improvement
> Components: core/index, core/search
> Affects Versions: 4.0
> Environment: 64bit linux java 1.6
> Reporter: peter chang
> Priority: Minor
> Labels: patch
> Fix For: 4.0
>
> Attachments: doc.fields.patch
>
>
> when generating digest for some documents with huge fields, it should be
> unnecessary to load the field but just interesting part of the field with the
> offset information. but indexreader always return the whole field content.
> afterward, the customized storedfieldsreader will got a repeated loading
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
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]