[ 
https://issues.apache.org/jira/browse/LUCENE-4461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13472164#comment-13472164
 ] 

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 twice? 
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: https://issues.apache.org/jira/browse/LUCENE-4461
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: modules/facet
>    Affects Versions: 3.6
>            Reporter: Rodrigo Vega
>              Labels: facet, faceted-search
>         Attachments: LuceneFacetTest.java
>
>
> Multiple FacetRequest are getting merged into one creating wrong results in 
> this case:
> FacetSearchParams facetSearchParams = new FacetSearchParams();
>               facetSearchParams.addFacetRequest(new CountFacetRequest(new 
> CategoryPath("author"), 10));
>               facetSearchParams.addFacetRequest(new CountFacetRequest(new 
> CategoryPath("author"), 10));
> 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: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to