It never works like you expect. You need to search for parents and then
hook up [child]. I see some improvements are coming, but now that is.

On Mon, Aug 6, 2018 at 9:11 PM omp...@rediffmail.com <omkar.pra...@gmail.com>
wrote:

> Thanks Mikhail verbose did help. _root_ field was missing in schema also in
> make some changes in child entity. Like i created id as alias to emp_id (
> in
> child query) which is id column of parent table.
>
>                 <entity name="parent" pk="id" datasource="ds-1"
> query="SELECT id,name
> FROM emp">
>                                 <field column="id" name="id" />
>                                 <field column="name" name="name" />
>                                         <entity child='true'
> name="child"  query="SELECT dept,emp_id as id
> FROM emp_details where emp_id='${parent.id}' ">
>                                                         <field
> column="dept" name="dept" />
>                                         </entity>
>                 </entity>
>
>
> Data seems to be returning correctly as below. but it show child documents
> and parent documents are shown as individual document. i was expecting 2
> documents and 2 child document for each doc.
> Any inputs will be helpful
>
>
>  "response":{"numFound":6,"start":0,"docs":[
>       {
>         "dept":"IT",
>         "id":"1",
>         "_version_":1608073809653399552},
>       {
>         "dept":"Data",
>         "id":"1",
>         "_version_":1608073809653399552},
>       {
>         "name":"omkar",
>         "id":"1",
>         "_version_":1608073809653399552},
>       {
>         "dept":"ITI",
>         "id":"2",
>         "_version_":1608073809667031040},
>       {
>         "dept":"Entry",
>         "id":"2",
>         "_version_":1608073809667031040},
>       {
>         "name":"ashwin",
>         "id":"2",
>         "_version_":1608073809667031040}]
>   }}
>
>
>
> --
> Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
>


-- 
Sincerely yours
Mikhail Khludnev

Reply via email to