From solr-user-return-142719-archive-asf-public=cust-asf.ponee.io@lucene.apache.org Wed Jul 25 23:50:25 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 3A65418062C for ; Wed, 25 Jul 2018 23:50:25 +0200 (CEST) Received: (qmail 1346 invoked by uid 500); 25 Jul 2018 21:50:23 -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 1322 invoked by uid 99); 25 Jul 2018 21:50:22 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Jul 2018 21:50:22 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 3206AC2DB7 for ; Wed, 25 Jul 2018 21:50:22 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.3 X-Spam-Level: X-Spam-Status: No, score=0.3 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id v_dVFyjIMeg6 for ; Wed, 25 Jul 2018 21:50:21 +0000 (UTC) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 2F5AF5F18F for ; Wed, 25 Jul 2018 21:50:21 +0000 (UTC) Received: from BHLMacAir2.T-mobile.com (75-101-48-44.dsl.static.fusionbroadband.com [75.101.48.44]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id w6PLoH5j019597 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT) for ; Wed, 25 Jul 2018 14:50:18 -0700 Subject: Re: How to retrieve nested documents (parents and their children together) ? To: solr-user@lucene.apache.org References: <5aaf190c-7712-c173-a4ba-73a297cbcf05@sonic.net> <5e785bde-4b7e-aac9-f815-d5ac57b76d82@sonic.net> <1be0c689-511a-10a9-268e-da296bc0c5c0@sonic.net> From: TK Solr Message-ID: Date: Wed, 25 Jul 2018 14:50:17 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Sonic-CAuth: UmFuZG9tSVbdG7bPVL8O8VyhYpWCB4x0mWePXkXXgKLqqhz2yfmksVLOn4aI25H0QpyJ8Wi8odmm4V0eK6qGrCAKx9mT7xZO X-Sonic-ID: C;4o35t1SQ6BGy+4G7ftbltA== M;kG7xuFSQ6BGy+4G7ftbltA== X-Sonic-Spam-Details: 0.0/5.0 by cerberusd Ah, that's what _root_ is for ! I was wondering. Thank you! On 7/25/18 2:36 PM, Mikhail Khludnev wrote: > _root_:parent-id > > чт, 26 июля 2018, 1:33 TK Solr : > >> The child doc transformer worked great. Thank you. >> >> In my experiment, posting 'parent-id' to the >> update >> end point only deleted the parent doc. Do I insert a complex join query >> from id >> to _version_ and delete all the docs of the matching _version_ ? >> >> >> On 7/24/18 9:27 PM, TK Solr wrote: >>> Thank you. I'll try the child doc transformer. >>> >>> On a related question, if I delete a parent document, will its children >> be >>> deleted also? Or do I have to have a parent_id field in each child so >> that the >>> child docs can be deleted? >>> >>> >>> On 7/22/18 10:05 AM, Mikhail Khludnev wrote: >>>> Hello, >>>> Check [child] >>>> >> https://lucene.apache.org/solr/guide/7_4/transforming-result-documents.html#child-childdoctransformerfactory >>>> or [subquery]. >>>> Although, it's worth to put reference to it somewhere in blockjoin >>>> qparsers. >>>> Documentation patches are welcome. >>>> >>>> >>>> On Sun, Jul 22, 2018 at 10:25 AM TK Solr wrote: >>>> >> https://lucene.apache.org/solr/guide/7_4/other-parsers.html#block-join-parent-query-parser >>>>> >>>>> talks about {!parent which=} >> >>>> child >>>>> docs>, which returns parent docs only, and >>>>> {!child of=} > docs>, >>>>> which >>>>> returns child docs only. >>>>> >>>>> Is there a way to retrieve the matched documents in the original, >> nested >>>>> form? >>>>> Using the sample document, is there way to get: >>>>> >>>>> >>>>> 1 >>>>> Solr has block join support >>>>> parentDocument >>>>> >>>>> 2 >>>>> SolrCloud supports it too! >>>>> >>>>> >>>>> >>>>> rather than just the parent or the child docs? >>>>> >>>>> >>>>> >>