lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Binoy Dalal <>
Subject Re: Parent Child Schema Design
Date Thu, 07 Jan 2016 08:17:32 GMT
How to index such documents is also given in the same blog under Indexing
Nested Documents.
You just need to add a json key _childDocuments_ to the doc and specify the
child doc as the value for this key.
There was a similar question on the mailing list earlier. You can find that

On Thu, 7 Jan 2016, 13:16 Pranaya Behera <> wrote:

> Hi,
>       I have read which states that there
> is no need for additional schema changes other than having a _root_
> which is already present in the schema.xml. But it never specified on
> for the child elements what would the schema look like. And the post
> actually uses curl with json to index data to solr. I am using python
> client to index data to solr.
> I have products as the core. This is one document but it has more
> interlinked child documents. As of now it is a single flat structure
> schema. But if I would like to use the parent-child relationship how
> would I go about it. Sample current schema:
> <field name="id" type="string" indexed="true" stored="true"
> required="true" multiValued="false" />
> <field name="_version_" type="long" indexed="true" stored="true"/>
> <field name="_root_" type="string" indexed="true" stored="false"/>
> <field name="_text_" type="text_general" indexed="true" stored="false"
> multiValued="true"/>
> <field name="name" type="text_general" indexed="true" stored="true"
> required="false" multiValued="false" />
> <field name="url" type="string" indexed="false" stored="false"
> required="false" />
> Now I would like to add child document to it. Lets say I would like to
> add another field named steps which will contain id, product_id, name,
> description. This steps would be a multivalued as per product we have
> multiple steps.
> Can someone help me figure out how to go about this ?
> --
> Thanks & Regards
> Pranaya Behera
> --
Binoy Dalal

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message