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 1B2F219E42 for ; Tue, 15 Mar 2016 11:04:33 +0000 (UTC) Received: (qmail 4569 invoked by uid 500); 15 Mar 2016 11:04:31 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 4515 invoked by uid 500); 15 Mar 2016 11:04:31 -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 4496 invoked by uid 99); 15 Mar 2016 11:04:31 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Mar 2016 11:04:31 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id CDF6D1A0265 for ; Tue, 15 Mar 2016 11:04:30 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.198 X-Spam-Level: * X-Spam-Status: No, score=1.198 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=wso2.com Received: from mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id Tz69GnJ7odiX for ; Tue, 15 Mar 2016 11:04:29 +0000 (UTC) Received: from mail-vk0-f44.google.com (mail-vk0-f44.google.com [209.85.213.44]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with ESMTPS id F15035F56C for ; Tue, 15 Mar 2016 11:04:28 +0000 (UTC) Received: by mail-vk0-f44.google.com with SMTP id c3so15457821vkb.3 for ; Tue, 15 Mar 2016 04:04:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wso2.com; s=google; h=mime-version:date:message-id:subject:from:to; bh=TzFImgOzExIoAWQ8uZ+85p23iheWQDpmk+Ol7IwrvRc=; b=dlLu4fDh7OY+y/yJ9LiWRncdANPmjK6eu2dzkC9qHhw+Frys8Zjd6/lLdk4Q3Vd7KN eJwibU8b7iJmZiTeJDSHzoMcawY6nvgcqR0ef6IQaIE0FQvA2Ydqb5od15W8uiB5Pomh Yd8/cAms9MUhhcV99fnqPLxKksb9MbG6Batq0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to; bh=TzFImgOzExIoAWQ8uZ+85p23iheWQDpmk+Ol7IwrvRc=; b=lJsBFcFJvXacX7YC5Te2PFV1iohTKF6OP2R5pnDQG37GhO2emhlQHXiIHI1mXYgZG9 IIdfyjmnlh74sDZ/ovp9DPo+QOMlbxj2fx8itxR2codh2csUKvf3c/PZm070hxTWgVxK NScUGs+RJVz5GnH8R/FWEzxazzF+EMkig0/uRL61rsDbXdkVDWY03EzXS70LUssdLW2W WO00hgg7nbJ7lkyEhq8cFvAFgZK3aTLU5GCMVQYUh0xmL7Hvp6hH+T2khMiBX7bLSbro JThmXJQb9Pn0H3vaYayso0YXla0BiPKzPagb22eotd25wU1smoo0R/0aWQxIj+OCc3Fm IHjQ== X-Gm-Message-State: AD7BkJIYssSWXGQH3tTALrC9iLm7ydZXH3+Lewb9ujE/xSEmkDOo5GYN0B6de4u1IIh2t9ZDapDtEeCWWaPz1Doq MIME-Version: 1.0 X-Received: by 10.31.133.7 with SMTP id h7mr29771483vkd.32.1458039862172; Tue, 15 Mar 2016 04:04:22 -0700 (PDT) Received: by 10.176.7.99 with HTTP; Tue, 15 Mar 2016 04:04:21 -0700 (PDT) Date: Tue, 15 Mar 2016 16:34:21 +0530 Message-ID: Subject: How to get the top facets values of a field/dimension which has the highest number of immediate children From: Gimantha Bandara To: java-user@lucene.apache.org Content-Type: multipart/alternative; boundary=001a114123c60db92f052e145cb7 --001a114123c60db92f052e145cb7 Content-Type: text/plain; charset=UTF-8 Hi, Lets say I have thousands of Lucene documents which have a FacetField which has the format of the following. doc.add(new FacetField("Category", "level0", "level1", "level2", "level3", ...)); "Category" is the dimension name. "level0" represents the first hierarchical level, "level1" represents the second hierarchical level of "level0" (or the immediate children of "level0") and so on.. How do I get the top "level0" values of "Category" which will have highest number of unique "level1" values along with the unique "level1" count? Thanks, Gimantha --001a114123c60db92f052e145cb7--