[ 
https://issues.apache.org/jira/browse/LUCENE-2831?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Simon Willnauer updated LUCENE-2831:
------------------------------------

    Attachment: LUCENE-2831.patch

here is an initial patch that cuts over the API to use a ReaderInfo struct. I 
upload that patch to get initial feedback for this rather massive change. 
Before i fix all JavaDoc etc. some others should review that first. The patch 
contains the following changes:

 * Cut over to use ReaderInfo in Weight#scorer, Weight#explain & 
Filter.getDocIdSet
 * Added ReaderInfo[] to IndexReader and its subclasses as well as 
IndexSearcher and Searcher which just forwards if applicable.
 * Fixed several, IMO legacy implementations in Solr code that still fixed the 
doc offset in explain
 * Removed all uses of SolrIndexReader#leaveReaders outside of SIR - IMO we can 
make those private to SIR now.
 * Added a DummySearcher to QueryWrapperFilter since it uses the subreader to 
obtain the weight from a query. That didn't work anymore since I assert now that
  the parent readers are identical in Weight#scorer
 * cut over IndexSearcher to use ReaderInfo instead of seq. subreader

What is definitly missing here from my point of view is:

 * sharpen the javadoc in weight, filter, and query to make clear how Weight, 
Rewrite & Scorer play together. For instance it should be clear that a query 
should only be executed against the same reader it was rewritten against.
 * possibly revise the getSeqSub & getSeqDocBase API in IR and maybe merge then 
in ReaderInfo
 * We should think about what we need in Scorer and Filter before we commit 
since this already changes the interface so we can do it here though. For 
instance could we include a _needsScoring_ flag in either Query#weight() or in 
the Weight#scorer() method. One other way would be to add those flags to the 
struct 
that is passed in but that would mean that we can not simply bind them to the 
IR and use them from there.
 

comments welcome!!

> Revise Weight#scorer & Filter#getDocIdSet API to pass Readers context
> ---------------------------------------------------------------------
>
>                 Key: LUCENE-2831
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2831
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Search
>    Affects Versions: 4.0
>            Reporter: Simon Willnauer
>            Assignee: Simon Willnauer
>             Fix For: 4.0
>
>         Attachments: LUCENE-2831.patch
>
>
> Spinoff from LUCENE-2694 - instead of passing a reader into Weight#scorer(IR, 
> boolean, boolean) we should / could revise the API and pass in a struct that 
> has parent reader, sub reader, ord of that sub. The ord mapping plus the 
> context with its parent would make several issues way easier. See 
> LUCENE-2694, LUCENE-2348 and LUCENE-2829 to name some.

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