lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gilad Barkai (JIRA)" <>
Subject [jira] [Commented] (LUCENE-4461) Multiple FacetRequest with the same path creates inconsistent results
Date Tue, 09 Oct 2012 06:04:03 GMT


Gilad Barkai commented on LUCENE-4461:

Nice catch!

Took a while to pinpoint the reason - lines 173-181 of StandardFacetsAccumulator.
In the mentioned lines, a 'merge' is performed over categories which matched the request,
but reside on different partitions. 

bq. Partitions are an optimization which limit the RAM requirements per query to a constant,
rather than linear to the taxonomy size (could be millions of categories). The taxonomy is
virtually "splitted" into partitions of constant size, a top-k is heaped from each partition,
and all those top-k results are being merged to a global top-k list

The proposed solution of changing the hashCode and equals so that the same request will have
two hashCodes and will not be equal to itself is very likely to break other parts of the code.

Perhaps such cases could be prevented all together? e.g throwing an exception when the (exact)
same request is added twice. 
Is that a reasonable solution? Are there cases where it is necessary to request the same path
Please note that a different count, depth, path etc - makes a different request, so requesting
"author" with count 10 and count 11 makes different requests - which are handled simultaneously
correctly in current versions. 

> Multiple FacetRequest with the same path creates inconsistent results
> ---------------------------------------------------------------------
>                 Key: LUCENE-4461
>                 URL:
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: modules/facet
>    Affects Versions: 3.6
>            Reporter: Rodrigo Vega
>              Labels: facet, faceted-search
>         Attachments:
> Multiple FacetRequest are getting merged into one creating wrong results in this case:
> FacetSearchParams facetSearchParams = new FacetSearchParams();
> 		facetSearchParams.addFacetRequest(new CountFacetRequest(new CategoryPath("author"),
> 		facetSearchParams.addFacetRequest(new CountFacetRequest(new CategoryPath("author"),
> Problem can be fixed by defining hashcode and equals in certain way that Lucene recognize
we are talking about different requests.
> Attached test case.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message