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:%22tempe...@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:\"tempe...@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:m...@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 <preeti.b...@shoregrp.com>
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:%22tempe...@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:%
> 22tempe...@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":["tempe...@tempest.com"]
> },
> {"email":["temper.tt...@tempt.com"]
> }
> ]
> }
>
> Thanks and Regards,
> Preeti Bhat
>
> -----Original Message-----
> From: Mikhail Khludnev [mailto:m...@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
> <preeti.b...@shoregrp.com>
> 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.e...@bbbbb.com"],
> >           "isPrimary":["true"]},
> >         {
> >           "id":"3556|45",
> >           "company_id":["45"],
> >           "email":["ehrijw.eer54...@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-supp...@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-supp...@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-supp...@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.


Reply via email to