lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shai Erera (JIRA)" <>
Subject [jira] Updated: (LUCENE-1593) Optimizations to TopScoreDocCollector and TopFieldCollector
Date Thu, 30 Apr 2009 10:56:30 GMT


Shai Erera updated LUCENE-1593:

    Attachment: LUCENE-1593.patch

Patch includes:
# New scoresDocsInOrder to Query
#* Default to false
#* Override in extensions to return true, except in BQ which still returns false until we
resolve how BQ is used explicitly (top-score vs. not). In some queries that delegate the work,
I used the delegatee or return true if all sub-queries return true.
# Changed TopFieldCollector and TopScoreDocCollector to take a docsScoredInOrder parameter
and create the appropriate instance (breaking ties by doc Id or not).
# Added TestTopScoreDocCollector and a test case to TestSort which test out-of-order collection
(they trigger the use of BooleanScorer, though whether document collection happens truly out
of order I cannot tell).
# Updates to CHANGES

All tests pass, including test-tag. BTW, the patch also includes the fix to TestSort in tag,
but without the fix for MultiSearcher and ParallelMultiSearcher on tag as I'm not sure if
we should back-port the fix as well.

> Optimizations to TopScoreDocCollector and TopFieldCollector
> -----------------------------------------------------------
>                 Key: LUCENE-1593
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Search
>            Reporter: Shai Erera
>             Fix For: 2.9
>         Attachments: LUCENE-1593.patch, LUCENE-1593.patch,
> This is a spin-off of LUCENE-1575 and proposes to optimize TSDC and TFC code to remove
unnecessary checks. The plan is:
> # Ensure that IndexSearcher returns segements in increasing doc Id order, instead of
> # Change TSDC and TFC's code to not use the doc id as a tie breaker. New docs will always
have larger ids and therefore cannot compete.
> # Pre-populate HitQueue with sentinel values in TSDC (score = Float.NEG_INF) and remove
the check if reusableSD == null.
> # Also move to use "changing top" and then call adjustTop(), in case we update the queue.
> # some methods in Sort explicitly add SortField.FIELD_DOC as a "tie breaker" for the
last SortField. But, doing so should not be necessary (since we already break ties by docID),
and is in fact less efficient (once the above optimization is in).
> # Investigate PQ - can we deprecate insert() and have only insertWithOverflow()? Add
a addDummyObjects method which will populate the queue without "arranging" it, just store
the objects in the array (this can be used to pre-populate sentinel values)?
> I will post a patch as well as some perf measurements as soon as I have them.

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