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 6F13217F39 for ; Tue, 30 Sep 2014 10:27:04 +0000 (UTC) Received: (qmail 63295 invoked by uid 500); 30 Sep 2014 10:27:02 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 63230 invoked by uid 500); 30 Sep 2014 10:27:02 -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 63217 invoked by uid 99); 30 Sep 2014 10:27:01 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Sep 2014 10:27:01 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of zhaoyonghui@gmail.com designates 209.85.217.178 as permitted sender) Received: from [209.85.217.178] (HELO mail-lb0-f178.google.com) (209.85.217.178) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Sep 2014 10:26:56 +0000 Received: by mail-lb0-f178.google.com with SMTP id w7so2901698lbi.9 for ; Tue, 30 Sep 2014 03:26:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=O60gHYs5GUE9xQw4glRb5inK5298aGaK4gpBOuA6gDE=; b=mE/XUxC37HOZT2bAYbHyYabKaG4c7aYPfcjASQGBwyQpv0tE406ceq1Hq8l1auU5IK 9pYrSQU9UI5MdSFcKNfTqLT8RqnCPElL0ZRl1CXJJbYwJt5X2U+Pr83A/xZc+TndUpar aFwuNhctiJObLUY9wdx5sxEQMS7y+jdx2JDr2a4JzFpPlbJi6gaWsrhb3OoUCid+4827 CPgIufdHZQOn5kAwnPhYU0gMpY/2B3p6/SwuT7hM+6GOHicGeTL51ojAyz2u2PRwYf4c Ugr6UsbHwZjHTuMjwvKYniGca8LpA5V5jKLiyYIvtBw9eXr7h+LvTB5XomtkP0xCnDni YyqQ== MIME-Version: 1.0 X-Received: by 10.112.130.226 with SMTP id oh2mr9353936lbb.100.1412072792324; Tue, 30 Sep 2014 03:26:32 -0700 (PDT) Received: by 10.25.170.200 with HTTP; Tue, 30 Sep 2014 03:26:32 -0700 (PDT) Date: Tue, 30 Sep 2014 18:26:32 +0800 Message-ID: Subject: confused facet example From: Yonghui Zhao To: java-user@lucene.apache.org Content-Type: multipart/alternative; boundary=047d7b3a82b02efe74050445d167 X-Virus-Checked: Checked by ClamAV on apache.org --047d7b3a82b02efe74050445d167 Content-Type: text/plain; charset=UTF-8 https://svn.apache.org/repos/asf/lucene/dev/branches/lucene_solr_4_8/lucene/demo/src/java/org/apache/lucene/demo/facet/SimpleFacetsExample.java In SimpleFacetsExample, /** Runs the search example. */ public List runFacetOnly() throws IOException { index(); return facetsOnly(); } /** Runs the search example. */ public List runSearch() throws IOException { index(); return facetsWithSearch(); } /** Runs the drill-down example. */ public FacetResult runDrillDown() throws IOException { index(); return drillDown(); } /** Runs the drill-sideways example. */ public List runDrillSideways() throws IOException { index(); return drillSideways(); } /** Runs the search and drill-down examples and prints the results. */ public static void main(String[] args) throws Exception { System.out.println("Facet counting example:"); System.out.println("-----------------------"); SimpleFacetsExample example1 = new SimpleFacetsExample(); List results1 = example1.runFacetOnly(); System.out.println("Author: " + results1.get(0)); System.out.println("Publish Date: " + results1.get(1)); System.out.println("Facet counting example (combined facets and search):"); System.out.println("-----------------------"); SimpleFacetsExample example = new SimpleFacetsExample(); List results = example.runSearch(); System.out.println("Author: " + results.get(0)); System.out.println("Publish Date: " + results.get(1)); System.out.println("\n"); System.out.println("Facet drill-down example (Publish Date/2010):"); System.out.println("---------------------------------------------"); System.out.println("Author: " + example.runDrillDown()); System.out.println("\n"); System.out.println("Facet drill-sideways example (Publish Date/2010):"); System.out.println("---------------------------------------------"); for(FacetResult result : example.runDrillSideways()) { System.out.println(result); } } The example doesn't new SimpleFacetsExample each time. So in drill-down example, it indexes 2 times, the result number is 2 times. in drill-sideways example. it indexes 3 times, the result number is 3 times. Is it intended? --047d7b3a82b02efe74050445d167--