Return-Path: X-Original-To: apmail-lucene-solr-user-archive@minotaur.apache.org Delivered-To: apmail-lucene-solr-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id ACFB918A3E for ; Mon, 23 Nov 2015 20:25:16 +0000 (UTC) Received: (qmail 16288 invoked by uid 500); 23 Nov 2015 20:25:11 -0000 Delivered-To: apmail-lucene-solr-user-archive@lucene.apache.org Received: (qmail 16218 invoked by uid 500); 23 Nov 2015 20:25:11 -0000 Mailing-List: contact solr-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: solr-user@lucene.apache.org Delivered-To: mailing list solr-user@lucene.apache.org Received: (qmail 15901 invoked by uid 99); 23 Nov 2015 20:25:11 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Nov 2015 20:25:11 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id DFBE9C0DD5 for ; Mon, 23 Nov 2015 20:25:10 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.9 X-Spam-Level: ** X-Spam-Status: No, score=2.9 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=griddynamics.com Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id Fu1NmYJk5KyN for ; Mon, 23 Nov 2015 20:25:01 +0000 (UTC) Received: from mail-lf0-f52.google.com (mail-lf0-f52.google.com [209.85.215.52]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTPS id 69C24206E3 for ; Mon, 23 Nov 2015 20:25:00 +0000 (UTC) Received: by lffu14 with SMTP id u14so118695745lff.1 for ; Mon, 23 Nov 2015 12:24:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=griddynamics.com; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=T7UuuOBuDMDRTBIc+evLNFRIAEyXJChZSiha4wFiYBM=; b=jF0a0kKKcEsSU7lAVwDWHJySF6ipY1ZOmtQHKdmsq9EV1wa5u5etWNaKFMgi2SfTJG nFZf2TBZb5OKJMycnHNIvLwtpnagDQUNw0ACKR/Bw5SbCI8JAiWYz00FU70P4Yre7NW8 H84Up/SRn/v71VoKMGsIT+o1SLY5VoUpcteEg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=T7UuuOBuDMDRTBIc+evLNFRIAEyXJChZSiha4wFiYBM=; b=bTWqU17Q8GBZZzT5SyInE3tSHdEPpewdDL2W9a+Kfj70e6uEbN/MGKOD8MD3e19T71 Lo4ULWtfgcw/dCxSVxNrkUdXtb3xIsVRpVNgbYbnDtHgi8aoeOa8UYPPtokOghiwW4Ou 8VZu/8oXbVAjryEbc4Z6mc30709Pyus/glK0f944bSK0VdnGn0VeGCGra96HGvWHBSkO c9p7J2L5XXpUrIY48ioQb7bfUQx/kLrhNxCZiYxMHNqIwIEbDA3Iymt2TJpvoEju44hu cCm5lwMUuFCpXgf+kWYl03Ts7X55Ed3qPfOlXqk2oKBMrkP44yKT/rSf0Zk/HinEJJop xOkQ== X-Gm-Message-State: ALoCoQklFhZouRj5O1TARKx0E+9S1uBypLrdQ2bi2XoAmf164mTwc6LXA8ByjJYqzbtrmayrvhG6 X-Received: by 10.25.169.212 with SMTP id s203mr9504795lfe.134.1448310299687; Mon, 23 Nov 2015 12:24:59 -0800 (PST) MIME-Version: 1.0 Received: by 10.114.185.103 with HTTP; Mon, 23 Nov 2015 12:24:20 -0800 (PST) In-Reply-To: References: From: Mikhail Khludnev Date: Mon, 23 Nov 2015 23:24:20 +0300 Message-ID: Subject: Re: Json Facet api on nested doc To: xavi jmlucjav Cc: solr-user Content-Type: multipart/alternative; boundary=001a114116b0f0184c05253b0446 --001a114116b0f0184c05253b0446 Content-Type: text/plain; charset=UTF-8 Indeed! Now it works for me too. JSON Facets seems powerful, but not friendly to me. Yonik, thanks for example! Xavi, I took json docs from http://yonik.com/solr-nested-objects/ and just doubled book2_c3 Here is what I have with json.facet={catz: {type:terms,field:cat_s, facet:{ starz:{type:terms, field:stars_i, domain:{blockChildren:'type_s:book'}} }}} { "responseHeader": { "status": 0, "QTime": 2, "params": { "q": "publisher_s:*", "json.facet": "{catz: {type:terms,field:cat_s, facet:{ starz:{type:terms, field:stars_i, domain:{blockChildren:'type_s:book'}} }}}", "indent": "true", "wt": "json", "_": "1448309900982" } }, "response": { "numFound": 2, "start": 0, "docs": [ { "id": "book1", "type_s": "book", "title_t": "The Way of Kings", "author_s": "Brandon Sanderson", "cat_s": "fantasy", "pubyear_i": 2010, "publisher_s": "Tor", "_version_": 1518570756086169600 }, { "id": "book2", "type_s": "book", "title_t": "Snow Crash", "author_s": "Neal Stephenson", "cat_s": "sci-fi", "pubyear_i": 1992, "publisher_s": "Bantam", "_version_": 1518570908026929200 } ] }, "facets": { "count": 2, "catz": { "buckets": [ { "val": "fantasy", "count": 1, "starz": { "buckets": [ { "val": 3, "count": 1 }, { "val": 5, "count": 1 } ] } }, { "val": "sci-fi", "count": 1, "starz": { "buckets": [ { "val": 2, "count": 2 }, { "val": 4, "count": 1 }, { "val": 5, "count": 1 } ] } } ] } } } It works well with *:* too. On Mon, Nov 23, 2015 at 12:56 AM, Yonik Seeley wrote: > On Sun, Nov 22, 2015 at 3:10 PM, Mikhail Khludnev > wrote: > > Hello, > > > > I also played with json.facet, but couldn't achieve the desired result > too. > > > > Yonik, Alessandro, > > Do you think it's a new feature or it can be achieved with the current > > implementation? > > Not sure if I'm misunderstanding the example, but it looks > straight-forward. > > terms facet on parent documents, with sub-facet on child documents. > I just committed a test for this, and it worked fine. See > TestJsonFacets.testBlockJoin() > > Can we see an example of a parent document being indexed (i.e. along > with it's child documents)? > > -Yonik > -- Sincerely yours Mikhail Khludnev Principal Engineer, Grid Dynamics --001a114116b0f0184c05253b0446--