Hi All,

I am trying to query records based on fields in both parent and child
documents. The query is not considering the field in the child document.
Below is the structure of my solr record.

<doc>
<str name="content_type">user</str>
<str name="id">21</str>
<str name="firstname_s">test</str>
<str name="lastname_s">****</str>
<str name="gender_s">M</str>
<str name="email_s">***@gmail.com</str>
<long name="_version_">1492932293590777856</long>
<doc>
    <str name="content_type">permanentAddress</str>
    <str name="id">21_172</str>
    <str name="address_s">sec-38</str>
    <str name="city_s">LosAngel</str>
    <str name="postalCode_s" />
</doc>
<doc>
    <str name="content_type">currentAddress</str>
    <str name="id">21_171</str>
    <str name="address_s">gurgaon</str>
    <str name="city_s">gurgaon</str>
    <str name="postalCode_s">120100</str>
</doc>

I am querying data based on two fields (firstname_s in parent and city_s in
child).

qf=firstname_s city_s

http://localhost:8984/solr/test/select?q=test+LosAngel&fq=
{!parent%20which=$parent_filter}&fl=*,[child%20parentFilter=$parent_filter]&parent_filter=content_type:user&defType=edismax&qf=firstname_s%20city_s^100&start=0&rows=20

This query is returning records from solr but if i change the q param to
only LosAngel then 0 records are returned. Here I am expecting all records
for which the city_s field in child docs equal to LosAngel.

I am new to solr and it would be of great help if one can point out what is
missing/wrong in the query or do I need to add some other parameters in the
query.

Thanks a lot,

Chandan

Reply via email to