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 67120DF75 for ; Mon, 27 May 2013 13:12:08 +0000 (UTC) Received: (qmail 66904 invoked by uid 500); 27 May 2013 13:12:06 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 66737 invoked by uid 500); 27 May 2013 13:12:05 -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 66710 invoked by uid 99); 27 May 2013 13:12:05 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 May 2013 13:12:05 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [80.88.19.1] (HELO fw-ext.incowia.com) (80.88.19.1) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 May 2013 13:11:58 +0000 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: =?iso-8859-1?Q?Re=3A_Faceted_Search=3A_count_direct_matches/member_f=FCr_?= =?iso-8859-1?Q?result_nodes?= Date: Mon, 27 May 2013 15:11:37 +0200 Message-ID: In-Reply-To: <1366887040.2077.14.camel@linux.scoobydoo> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: =?iso-8859-1?Q?Re=3A_Faceted_Search=3A_count_direct_matches/member_f=FCr_?= =?iso-8859-1?Q?result_nodes?= Thread-Index: Ac5BotWTvc/iLer3Ssi3FkuXClz8rwZN7qsg References: <1366887040.2077.14.camel@linux.scoobydoo> From: "Schimke, Danny" To: , X-Virus-Checked: Checked by ClamAV on apache.org Hi, currently I have time to try out your suggestions. First I want try = using the advice using "OrdinalPolicy". But I have problems defining the Params FacetIndexingParams. How do I = create those params with the required OrdinalPolicy? I already searched a lot, but found no solution yet. Here is a small = snipped of code for indexing: List categories =3D new ArrayList(); for (String path : paths) { CategoryPath cat =3D new CategoryPath(FIELD_GROUP_ID + "/" + path, = '/'); categories.add(cat); } for (CategoryPath path : categories) { taxoWriter.addCategory(path); } ... // TODO FacetIndexingParams need to be added here... FacetFields ff =3D new FacetFields(taxoWriter); ff.addFields(doc, categories); Thanks a lot in advance! -Danny -----Urspr=FCngliche Nachricht----- Von: Nicola Buso [mailto:nbuso@ebi.ac.uk]=20 Gesendet: Donnerstag, 25. April 2013 12:51 An: java-user@lucene.apache.org Betreff: Re: Faceted Search: count direct matches/member f=FCr result = nodes Hi, which version of Lucene? Check the OrdinalPolicy you are using in FacetIndexingParams at indexing time. I think you should use: NonTopLevelOrdinalPolicy in lucene 3.6.1 or OrdinalPolicy.ALL_BUT_DIMENSION in lucene 4.2.1 Nicola. On Thu, 2013-04-25 at 08:32 +0200, Schimke, Danny wrote: > Hi, >=20 > =20 >=20 > I am new to lucene. I've done some basics so far. Currently I have to = deal with Faceted Search. >=20 > =20 >=20 > Given: >=20 > For example I have the following categories: >=20 > =20 >=20 > Root >=20 > Root/idA/ >=20 > Root/idA/idB >=20 > Root/idA/idB/idC >=20 > =20 >=20 > Scenario: >=20 > The search result delivers the folowing FacetResult for example: >=20 > =20 >=20 > Root (5) >=20 > Root/idA (5) >=20 > Root/idA/idB (3) >=20 > Root/idA/idB/idC (3) >=20 > =20 >=20 > That means 2 direct matches for Root/idA and 3 direct matches for = Root/idA/idB/idC. >=20 > =20 >=20 > But I want ability to get the count that one category exactly has, = without consideration of the subcategories (only "direct" member), e.g.: >=20 > =20 >=20 > Root (0) >=20 > Root/idA (2) >=20 > Root/idA/idB (0) >=20 > Root/idA/idB/idC (3) >=20 > =20 >=20 > Maybe there is a standard way don't calculate this by hand in = dependence to subcategories? >=20 > =20 >=20 > How can I achieve this? >=20 > Thanks a lot in advance! >=20 > =20 >=20 > -Danny >=20 --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org