You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by sonaliw <so...@gmail.com> on 2018/08/13 09:34:17 UTC

create Nested index structure SOLR

I want to create nested index structure with SOLR import handler. I am using
Solr -7.2 ,I have created data-config.xml
(https://issues.apache.org/jira/browse/SOLR-5147),

<document>
        <entity name="PARENT" query="select * from parent">
          <field column="id" />
          <field column="title" />
          <field column="type_s" />
          <entity child="true" name="CHILD" query="select * from child where 
           parent_id='${PARENT.id}'">
                <field column="id" />
                <field column="post" />
                    <field column="parent_id" />
          </entity>
    </entity>   
 </document>
but I am not getting nested index document as result of below query,
http://xyzhost:8983/solr/myCollection/select?fl=,[child%20parentFilter=title:%22test%22]&q=:* 

Imported document looks like below,

` "response":{"numFound":6,"start":0,"docs":[
  {
    "post":"dev1",
    "parent_id":"1",
    "id":"1",
    "_version_":1608402260456374272},
  {
    "post":"dev3",
    "parent_id":"1",
    "id":"3",
    "_version_":1608402260456374272},
  {
    "id":"1",
    "title":"test1",
    "_version_":1608402260456374272},
  {
    "post":"dev2",
    "parent_id":"2",
    "id":"2",
    "_version_":1608402260460568576},
  {
    "post":"dev4",
    "parent_id":"4",
    "id":"4",
    "_version_":1608402260460568576},
  {
    "id":"2",
    "title":"test2",
    "_version_":1608402260460568576}]
}}`

What I am missing here ?



--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html

Re: create Nested index structure SOLR

Posted by Mikhail Khludnev <mk...@apache.org>.
This is just a flatten internal representation of actually nested docs.

On Mon, Aug 13, 2018 at 2:00 PM sonaliw <so...@gmail.com> wrote:

> I want to create nested index structure with SOLR import handler. I am
> using
> Solr -7.2 ,I have created data-config.xml
> (https://issues.apache.org/jira/browse/SOLR-5147),
>
> <document>
>         <entity name="PARENT" query="select * from parent">
>           <field column="id" />
>           <field column="title" />
>           <field column="type_s" />
>           <entity child="true" name="CHILD" query="select * from child
> where
>            parent_id='${PARENT.id}'">
>                 <field column="id" />
>                 <field column="post" />
>                     <field column="parent_id" />
>           </entity>
>     </entity>
>  </document>
> but I am not getting nested index document as result of below query,
>
> http://xyzhost:8983/solr/myCollection/select?fl=,[child%20parentFilter=title:%22test%22]&q=:*
>
> Imported document looks like below,
>
> ` "response":{"numFound":6,"start":0,"docs":[
>   {
>     "post":"dev1",
>     "parent_id":"1",
>     "id":"1",
>     "_version_":1608402260456374272},
>   {
>     "post":"dev3",
>     "parent_id":"1",
>     "id":"3",
>     "_version_":1608402260456374272},
>   {
>     "id":"1",
>     "title":"test1",
>     "_version_":1608402260456374272},
>   {
>     "post":"dev2",
>     "parent_id":"2",
>     "id":"2",
>     "_version_":1608402260460568576},
>   {
>     "post":"dev4",
>     "parent_id":"4",
>     "id":"4",
>     "_version_":1608402260460568576},
>   {
>     "id":"2",
>     "title":"test2",
>     "_version_":1608402260460568576}]
> }}`
>
> What I am missing here ?
>
>
>
> --
> Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
>


-- 
Sincerely yours
Mikhail Khludnev