lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jamie M <>
Subject [PATCH] sorting bug in current cvs
Date Sat, 07 Feb 2004 12:47:36 GMT

I've checked the current jakarta-lucene code out from
cvs and tried out the new sorting functionality.  It
appears that there is a bug when multiple documents
have the same relative sort order.  

When FieldSortedHitQueue builds its array of relative
sort orders for each doc it skips any documents with
the same relative sort order of a document it has
already seen, giving them the default sort order of
zero, which means they end up being at the top of any
result list.

Attached is a junit test case which shows this bug,
and a patch which fixes it.  I've only aimed for a
functional fix, and haven't tested whether the
performance of the patched code differs from that of
the current code.

I see that Tim Jones recently submitted some patches
which further extend the sorting functionality and
also render my bugfix redundant.  However, since the
sort code with the bug is currently in cvs, and Tim's
new code isn't I figured I should submit this anyway -
even if it just serves to speed up the inclusion of
Tim's patches which I eagerly await :-)



Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
View raw message