Return-Path: X-Original-To: apmail-lucene-dev-archive@www.apache.org Delivered-To: apmail-lucene-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4512EDEEB for ; Tue, 9 Oct 2012 06:04:10 +0000 (UTC) Received: (qmail 6231 invoked by uid 500); 9 Oct 2012 06:04:09 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 5718 invoked by uid 500); 9 Oct 2012 06:04:04 -0000 Mailing-List: contact dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list dev@lucene.apache.org Received: (qmail 5244 invoked by uid 99); 9 Oct 2012 06:04:03 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Oct 2012 06:04:03 +0000 Date: Tue, 9 Oct 2012 06:04:03 +0000 (UTC) From: "Gilad Barkai (JIRA)" To: dev@lucene.apache.org Message-ID: <1010929576.13191.1349762643133.JavaMail.jiratomcat@arcas> In-Reply-To: <329894505.1244.1349450524241.JavaMail.jiratomcat@arcas> Subject: [jira] [Commented] (LUCENE-4461) Multiple FacetRequest with the same path creates inconsistent results MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ 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-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org