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

Grant Ingersoll commented on LUCENE-762:
----------------------------------------

I agree, Chuck, I sometimes wish you could have JAR level access or something 
like that.  Off topic, but doesn't C++ have a friend operator (not that I'm 
wishing for the C++ days) that lets you do these kind of things.

I originally put FieldSelector in the Document package b/c I felt it was more 
closely associated with Documents and Fields than the Index package.  Now, I 
guess, since the FieldsReader is in Index, I can see a strong argument for that 
location.

Anyway, I thought of an alternative that should keep everyone happy:
Create a new Interface named FieldInfoAccessor which provides get methods for 
the properties on FieldInfo, which will implement the interface.  Pass that to 
FieldSelectorResult.readField method instead of FieldInfo and proceed as stated 
above.  

The only sticking point I am now having is what to do with the Lazy Fields, 
since they require the ThreadLocal in FieldsReader.  I guess I would have to 
pass in the cloneable Fields Reader and the threadlocal, but that doesn't seem 
quite right either.  Any thoughts?  Moving the FieldSelector stuff into index 
package wouldn't address this, I don't think.  Maybe a brilliant thought will 
occur to me in the morning.

> [PATCH] Efficiently retrieve sizes of field values
> --------------------------------------------------
>
>                 Key: LUCENE-762
>                 URL: https://issues.apache.org/jira/browse/LUCENE-762
>             Project: Lucene - Java
>          Issue Type: New Feature
>          Components: Store
>    Affects Versions: 2.1
>            Reporter: Chuck Williams
>         Assigned To: Grant Ingersoll
>            Priority: Minor
>         Attachments: SizeFieldSelector.patch
>
>
> Sometimes an application would like to know how large a document is before 
> retrieving it.  This can be important for memory management or choosing 
> between algorithms, especially in cases where documents might be very large.
> This patch extends the existing FieldSelector mechanism with two new 
> FieldSelectorResults:  SIZE and SIZE_AND_BREAK.  SIZE creates fields on the 
> retrieved document that store field sizes instead of actual values.  
> SIZE_AND_BREAK is especially efficient if one field comprises the bulk of the 
> document size (e.g., the body field) and can thus be used as a reasonable 
> size approximation.

-- 
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to