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

Uwe Schindler edited comment on LUCENE-5327 at 11/8/13 6:55 AM:
----------------------------------------------------------------

DocValues are not really fast with MultiDocValues, because it uses a binary 
search to find the document ID.

If you want them on the IndexReader level, use 
SlowCompositeReaderWrapper.wrap(yourReader), which exposes all atomic APIs on a 
composite reader, too. This is easier to use than MultiDocValues, because it 
covers more cases.

There is a reason to differentiate between composite and atomic readers: Stuff 
that can be done on the atomic level natively and fast should be exposed via 
AtomicReader, but only stuff that can be done fast on the composite level, 
should be exposed on the composite level. Stored fields are some special case, 
because they are used quite often to display search results, but DocValues 
aren't. This is why they are in the top-level IndexReader API (which is wrong 
from the standpoint of code design, but it is more for ease of use).

For everything else there are tons of wrapper APIs like 
SlowCompositeReaderWrapper [extends AtomicReader] which emulates the old Lucene 
3.x way of IndexReader before they were splitted). By using them you know, that 
it might not be the fastest approach.

Please close this issue as won't fix, thanks.


was (Author: thetaphi):
DocValues are not really fast with MultiDocValues, because it uses a binary 
search to find the document ID.

If you want them on the IndexReader level, use 
SlowCompositeReaderWrapper.wrap(yourReader), which exposes all atomic APIs on a 
composite reader, too. This is easier to use than MultiDocValues, because it 
covers more cases.

There is a reason to differentiate between composite and atomic readers: Only 
stuff that can be done on the atomic level natively and fast should be exposed 
via AtomicReader. For everything else there are tons of wrapper APIs like 
SlowCompositeReaderWrapper [extends AtomicReader] which emulates the old Lucene 
3.x way of IndexReader before they were splitted). By using them you know, that 
it might not be the fastest approach.

Please close this issue as won't fix, thanks.

> Expose getNumericDocValues and getBinaryDocValues at toplevel reader and 
> searcher levels
> ----------------------------------------------------------------------------------------
>
>                 Key: LUCENE-5327
>                 URL: https://issues.apache.org/jira/browse/LUCENE-5327
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: core/search
>    Affects Versions: 4.5
>            Reporter: John Wang
>         Attachments: patch.diff
>
>
> Expose NumericDocValues and BinaryDocValues in both IndexReader and 
> IndexSearcher apis.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to