lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Miller (JIRA)" <>
Subject [jira] Commented: (LUCENE-1821) Weight.scorer() not passed doc offset for "sub reader"
Date Tue, 18 Aug 2009 23:02:14 GMT


Mark Miller commented on LUCENE-1821:

You should pull that info from a top level reader and somehow pass it to your scorer through
your query impl or something than.

We are working very hard to make search per segment and discourage non per segment use - it
doesn't seem like you want to be consulting the entire index on every call to scorer. Passing
the base around does not help you with looking at the whole index either - just in terms of
doc ids - which we don't support externally - and you are essentially caching them externally.
The document ids should be purely internal - I don't think we want to support documents in
one segment being aware of docs in another segment either.

createWeight on Query gives you the opportunity to grab stuff your Scorer may need top level
(off the Searcher).

You could also make a new Query each time that takes a top level IndexReader and uses it.

You can also override IndexSearcher (as you have) and work around things there.

> Weight.scorer() not passed doc offset for "sub reader"
> ------------------------------------------------------
>                 Key: LUCENE-1821
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Search
>    Affects Versions: 2.9
>            Reporter: Tim Smith
> Now that searching is done on a per segment basis, there is no way for a Scorer to know
the "actual" doc id for the document's it matches (only the relative doc offset into the segment)
> If using caches in your scorer that are based on the "entire" index (all segments), there
is now no way to index into them properly from inside a Scorer because the scorer is not passed
the needed offset to calculate the "real" docid
> suggest having Weight.scorer() method also take a integer for the doc offset
> Abstract Weight class should have a constructor that takes this offset as well as a method
to get the offset
> All Weights that have "sub" weights must pass this offset down to created "sub" weights

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:
For additional commands, e-mail:

View raw message