Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 53509200C0D for ; Tue, 31 Jan 2017 09:03:36 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 51E74160B52; Tue, 31 Jan 2017 08:03:36 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 9C559160B46 for ; Tue, 31 Jan 2017 09:03:35 +0100 (CET) Received: (qmail 56397 invoked by uid 500); 31 Jan 2017 08:03:34 -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 56384 invoked by uid 99); 31 Jan 2017 08:03:34 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 Jan 2017 08:03:33 +0000 Received: from mail-it0-f51.google.com (mail-it0-f51.google.com [209.85.214.51]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id BD1BB1A00A8 for ; Tue, 31 Jan 2017 08:03:33 +0000 (UTC) Received: by mail-it0-f51.google.com with SMTP id 203so211709841ith.0 for ; Tue, 31 Jan 2017 00:03:33 -0800 (PST) X-Gm-Message-State: AIkVDXLoxuT+4c42cizKp/NLwqB9/j4ukLQxe65nXpLxnTXCFlv2Kz+tqHH5BIqMcdROOHt0mqOn/n6Bhg+dqw== X-Received: by 10.36.46.5 with SMTP id i5mr19982331ita.23.1485849812960; Tue, 31 Jan 2017 00:03:32 -0800 (PST) MIME-Version: 1.0 Received: by 10.64.211.166 with HTTP; Tue, 31 Jan 2017 00:03:32 -0800 (PST) In-Reply-To: References: From: Mikhail Khludnev Date: Tue, 31 Jan 2017 11:03:32 +0300 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Return specific field from child documents. To: solr-user Content-Type: multipart/alternative; boundary=001a114a97044a972805475f5e69 archived-at: Tue, 31 Jan 2017 08:03:36 -0000 --001a114a97044a972805475f5e69 Content-Type: text/plain; charset=UTF-8 it should be something like emp.q={!child of=content_type:parent}{!terms f=contact_id v=$row.id} On Tue, Jan 31, 2017 at 10:30 AM, Preeti Bhat wrote: > Hi Mikhail, > > I was trying to restrict the data from child documents due to one of the > request of the client where they would need the specific fields as output. > The below query gives me the firstName and Last Name as expected but not > the email which is part of the child document. > http://localhost:8984/solr/Contact/select?fl=FirstName, > LastName,email,%20[child%20parentFilter=content_type: > parent%20]&indent=on&q={!parent%20which=%22content_ > type:parent%22}%20email:%22temper.t@tempest.com%22&wt=json > > I did try the sub query, but its returning only the parent document. Not > sure if I am missing something here. > > http://localhost:8984/solr/Contact/select??fl=id, > FirstName,email,emp:[subquery]&emp.rows=10&emp.fl=email&emp. > q={!term%20f=contact_id%20v=$row.id}&indent=on&q=%7b! > parent%20which=%22content_type:parent%22%7d%20email:% > 22temper.t@tempest.com%22&wt=json&expandMacros=true > > I am expecting the result to be something like this. Could you please > advise. > { > "FirstName":"temptest", > "LastName":"temper", > "_childDocuments_":[ > { "email":["temper.t@tempest.com"] > }, > {"email":["temper.ttttt@tempt.com"] > } > ] > } > > Thanks and Regards, > Preeti Bhat > > -----Original Message----- > From: Mikhail Khludnev [mailto:mkhl@apache.org] > Sent: Monday, January 30, 2017 5:49 PM > To: solr-user > Subject: Re: Return specific field from child documents. > > Hello, > > You hardly get any gain limiting child field output. You can do that with > [subquery] result transformer. > > On Mon, Jan 30, 2017 at 11:09 AM, Preeti Bhat > wrote: > > > Hi All, > > > > I am trying out the nested documents concept for SOLR. I am able to > > show the specific field for the parent document like > > "FirstName","LastName" but I am not able to show the specific field in > fl for child. > > > > I would like to retrieve the email from the _childDocuments. Could > > someone please advise. > > > > Q=+FirstName:"etr4tr" {!parent which="content_type:parent"} > > Fl=FirstName,LastName,email, [child parentFilter=content_type:parent ] > > > > "response":{"numFound":1,"start":0,"docs":[ > > { > > "FirstName":"etr4tr", > > "LastName":"wrer6t", > > "_childDocuments_":[ > > { > > "id":"3556|12", > > "company_id":["12"], > > "email":["ehrijw.egru@bbbbb.com"], > > "isPrimary":["true"]}, > > { > > "id":"3556|45", > > "company_id":["45"], > > "email":["ehrijw.eer54gru@ccc.com"]}]}] > > }} > > > > > > Thanks and Regards, > > Preeti Bhat > > > > > > > > NOTICE TO RECIPIENTS: This communication may contain confidential > > and/or privileged information. If you are not the intended recipient > > (or have received this communication in error) please notify the > > sender and it-support@shoregrp.com immediately, and destroy this > > communication. Any unauthorized copying, disclosure or distribution of > > the material in this communication is strictly forbidden. Any views or > > opinions presented in this email are solely those of the author and do > > not necessarily represent those of the company. Finally, the recipient > > should check this email and any attachments for the presence of > > viruses. The company accepts no liability for any damage caused by any > virus transmitted by this email. > > > > > > > > > -- > Sincerely yours > Mikhail Khludnev > > NOTICE TO RECIPIENTS: This communication may contain confidential and/or > privileged information. If you are not the intended recipient (or have > received this communication in error) please notify the sender and > it-support@shoregrp.com immediately, and destroy this communication. Any > unauthorized copying, disclosure or distribution of the material in this > communication is strictly forbidden. Any views or opinions presented in > this email are solely those of the author and do not necessarily represent > those of the company. Finally, the recipient should check this email and > any attachments for the presence of viruses. The company accepts no > liability for any damage caused by any virus transmitted by this email. > > > -- Sincerely yours Mikhail Khludnev --001a114a97044a972805475f5e69--