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 4B922200C0D for ; Tue, 31 Jan 2017 10:45:09 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 4A159160B52; Tue, 31 Jan 2017 09:45:09 +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 6AF5D160B46 for ; Tue, 31 Jan 2017 10:45:08 +0100 (CET) Received: (qmail 46573 invoked by uid 500); 31 Jan 2017 09:45:06 -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 46562 invoked by uid 99); 31 Jan 2017 09:45:06 -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 09:45:06 +0000 Received: from mail-it0-f54.google.com (mail-it0-f54.google.com [209.85.214.54]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id 6FB631A00A8 for ; Tue, 31 Jan 2017 09:45:06 +0000 (UTC) Received: by mail-it0-f54.google.com with SMTP id k200so27367871itb.1 for ; Tue, 31 Jan 2017 01:45:06 -0800 (PST) X-Gm-Message-State: AIkVDXKJ2P7f6vAv3gPYBYn4IvQfBMn6L5YucsqA9jkABoyCxDDPtul5Bp7TjoQRzEC1LiYUj4sn/JsVtoIbZw== X-Received: by 10.36.112.146 with SMTP id f140mr18888462itc.51.1485855905754; Tue, 31 Jan 2017 01:45:05 -0800 (PST) MIME-Version: 1.0 Received: by 10.64.211.166 with HTTP; Tue, 31 Jan 2017 01:45:05 -0800 (PST) In-Reply-To: References: From: Mikhail Khludnev Date: Tue, 31 Jan 2017 12:45:05 +0300 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Return specific field from child documents. To: solr-user Content-Type: multipart/alternative; boundary=001a113f7318733abe054760c948 archived-at: Tue, 31 Jan 2017 09:45:09 -0000 --001a113f7318733abe054760c948 Content-Type: text/plain; charset=UTF-8 ok. what about emp.q={!child of=content_type:parent}{!terms f=id v=$row.id} On Tue, Jan 31, 2017 at 11:22 AM, Preeti Bhat wrote: > Hi Mikhail, > > Thanks for reply, but It doesn't seem to work. > > http://localhost:8984/solr/Contact/select?fl=id, > FirstName,emp:[subquery]&emp.rows=10&emp.fl=email&emp.q={! > child%20of=content_type:parent}{!term%20f=contact_id% > 20v=$row.id}&indent=on&q={!parent%20which=%22content_ > type:parent%22}%20email:%22temper.t@tempest.com%22&wt= > json&expandMacros=true > > I am getting the below response. > > { > "responseHeader":{ > "zkConnected":true, > "status":0, > "QTime":0, > "params":{ > "emp.fl":"email", > "q":"{!parent which=\"content_type:parent\"} email:\" > temper.t@tempest.com\"", > "emp.rows":"10", > "indent":"on", > "expandMacros":"true", > "fl":"id,FirstName,emp:[subquery]", > "emp.q":"{!child of=content_type:parent}{!term f=contact_id v=$ > row.id}", > "wt":"json"}}, > "response":{"numFound":1,"start":0,"docs":[ > { > "id":"7888", > "FirstName":"temptest"}] > }} > > Thanks and Regards, > Preeti Bhat > > -----Original Message----- > From: Mikhail Khludnev [mailto:mkhl@apache.org] > Sent: Tuesday, January 31, 2017 1:34 PM > To: solr-user > Subject: Re: Return specific field from child documents. > > 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 > > 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 --001a113f7318733abe054760c948--