Return-Path: X-Original-To: apmail-lucene-java-user-archive@www.apache.org Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E0934745B for ; Thu, 22 Sep 2011 08:11:11 +0000 (UTC) Received: (qmail 57180 invoked by uid 500); 22 Sep 2011 08:11:09 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 57129 invoked by uid 500); 22 Sep 2011 08:11:09 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 57121 invoked by uid 99); 22 Sep 2011 08:11:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Sep 2011 08:11:09 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=FREEMAIL_FROM,SPF_NEUTRAL,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [72.30.239.142] (HELO nm32-vm6.bullet.mail.bf1.yahoo.com) (72.30.239.142) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 22 Sep 2011 08:10:53 +0000 Received: from [98.139.212.148] by nm32.bullet.mail.bf1.yahoo.com with NNFMP; 22 Sep 2011 08:10:32 -0000 Received: from [98.139.212.196] by tm5.bullet.mail.bf1.yahoo.com with NNFMP; 22 Sep 2011 08:10:31 -0000 Received: from [127.0.0.1] by omp1005.mail.bf1.yahoo.com with NNFMP; 22 Sep 2011 08:10:31 -0000 X-Yahoo-Newman-Id: 985060.52921.bm@omp1005.mail.bf1.yahoo.com Received: (qmail 71397 invoked from network); 22 Sep 2011 08:10:31 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.de; h=DKIM-Signature:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=NYp37E3f1JE9rvIuXRdunJ19tVPHmx2BTgKxKj+3KEsiCjOyvkedZPzH5ZSHkABAKWDwTPhO/7YsJTwdiL1xXo285sZcbTV9zdBYOrLuHnmFhSUztRaolDFOhiw7S7Sy5cnRBkf4aQr8kv9ykpd3ArDX3AxCQM9yfsq+tEoh6gw= ; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s1024; t=1316679031; bh=eskE8Uhzt/42h9pp4lHhtYxwOGG29nG/svdUSv6nrH4=; h=X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=QQN+tJS9uUD97vTCciaAAN5cmmb58vBL+Px9B1E1q9jvFaNYQAaJ8R2lMkGkq1ORe0FWpfFx73OqVCfPbWC2hoUCgUiXecJ8/dAowB5yPbHeoQSYWxaOTQtdsVvfv+XGoaZcuWxjlvd109DkA5CvP/6Z2hjnxgYlIZ126iQK+rc= X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: hbFbli0VM1nhQ84NF0H5He2k6uoDwUu2IB.QM6o4OqgSjX9 5VkzuDkHcsDlOUNQ7P6Ht6t2C4soXXAU01O4OJ43wQMYyG9yq8JbTHgSM54h iW_aQYHfVUNWTuhq5VEDN2m.y_fMaSD.s6q6EeGo4SQKlDsFfyzvHnEDv0V4 W7xlh7XN.rWOQf6sIodN7fJ4llv.s0WMyLqluZQuLoPV7Py8jGZ2HNJBGz0G w0zQ_aTl1Q.zNekAz2E3TeGYS.HounDRRaPtbBEUS8BBzLvGlYq3zat.SMbQ BBa_N.iJ1pCzYk06pT1ffcMjXWoYfKRoiKziAdAMoHM3HdWcU_8yUdtmX63o BtnpUdF0b7KgS37i6IbqWE2Z_jbe2xlbHjBGBpWLurtrOGOYBiRjfNogSiyz gWJ6ybSq0ERo7nxgRbnhW16_h.U3x8p_4ZiTyy8iIO_22T4dFJhieCZMe7Pa 8U32HDT1EZvGlx5oz8hnCCJbVGQ-- X-Yahoo-SMTP: PsU70jWswBCjvY7DVEwAV7Ld71kq2utxAu93BRGFPho- Received: from [192.168.0.2] (mailformailinglists@91.12.245.1 with plain) by smtp111.mail.bf1.yahoo.com with SMTP; 22 Sep 2011 01:10:31 -0700 PDT Message-ID: <4E7AED74.1040106@yahoo.de> Date: Thu, 22 Sep 2011 10:10:28 +0200 From: Em User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:6.0.2) Gecko/20110902 Thunderbird/6.0.2 MIME-Version: 1.0 To: java-user@lucene.apache.org Subject: Re: FacetedSearch DrillDown References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi, I just saw that this is about Lucene, not Solr. So I am sorry for giving a Solr-advice on a Lucene-topic. Shai, I just found the Facet-Contribution's API via Google. Where are references to that API? I can not find them in Lucene's Wiki or at the Lucene-page. I'd like to read a little bit more about this contribution to compare it with existing approaches in Solr. Thanks! Em Am 22.09.2011 09:08, schrieb Shai Erera: > Hi Mihai, > > thanks for clarifying the question. The facet module supports that quite > easily actually. I've included a sample code with some description: > > (1) FacetSearchParams fsp = new FacetSearchParams(); > (2) CountFacetRequest facetRequest = new CountFacetRequest(new > CategoryPath("monday"), 10); > (3) facetRequest.setDepth(3); > (4) fsp.addFacetRequest(facetRequest); > (5) FacetsCollector col = new FacetsCollector(fsp, > searcher.getIndexReader(), taxoReader); > (6) searcher.search(new MatchAllDocsQuery(), col); > (7) System.out.println(col.getFacetResults().get(0)); > > Explanation: > (1) -- create FacetSearchParams with the default FacetIndexingParams. This > is the common case. > (2) -- Create CountFacetRequest, for the 'monday' node (which is the > top-level node in your example), and specify that the top-10 counted > categories should be returned. > (3) -- Specify depth=3, which means that the top-K (10 in this example) > should be computed among all nodes up to depth '3'. > (4) -- add the FacetRequest to the search params. > (5) -- Create the FacetsCollector > (6) -- Issue the search > (7) -- Print the result, in this case only one FacetResult exists because > only one dimension (FacetRequest) was asked. > > This prints the following: > > Request: monday nRes=10 nLbl=10 > Num valid Descendants (up to specified depth): 5 > Facet Result Node with 5 sub result nodes. > Name: monday > Value: 3.0 > Residue: 0.0 > > Subresult #0 > Facet Result Node with 0 sub result nodes. > Name: monday/1pm > Value: 2.0 > Residue: 0.0 > > Subresult #1 > Facet Result Node with 0 sub result nodes. > Name: monday/2pm/3min > Value: 1.0 > Residue: 0.0 > > Subresult #2 > Facet Result Node with 0 sub result nodes. > Name: monday/2pm > Value: 1.0 > Residue: 0.0 > > Subresult #3 > Facet Result Node with 0 sub result nodes. > Name: monday/1pm/4min > Value: 1.0 > Residue: 0.0 > > Subresult #4 > Facet Result Node with 0 sub result nodes. > Name: monday/1pm/3min > Value: 1.0 > Residue: 0.0 > > I believe that's what you were looking for? > > The DrillDown class provide helper utility methods for drilling-down on a > selected facet. I.e., if you return the user the above results, and he > clicks on "Monday/1pm", you want to constraint the search to this category > only. The DrillDown class helps you create a Query out of the user's > selection. > > We wrote a very extensive userguide which unfortunately didn't make it into > the release. I've attached its PDF version in this issue: > https://issues.apache.org/jira/browse/LUCENE-3261. I intend to make an HTML > version out of it, so that it will be included with future releases. > Apologies for the delay. > > Shai > > On Wed, Sep 21, 2011 at 10:44 PM, Mihai Caraman wrote: > >> monday, 1pm, 3min > --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org