lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Binoy Dalal <binoydala...@gmail.com>
Subject Re: Parent Child Schema Design
Date Thu, 07 Jan 2016 13:14:21 GMT
Yes. Provided your fields are already defined.

On Thu, 7 Jan 2016, 17:52 Pranaya Behera <pranaya.behera@igp.com> wrote:

> Hi Binay,
>                Are you saying there is no need to add anything to the
> existing schema that I have ? While indexing all I have to provide is a
> _childDocuments_ key and the key => value pair as per I want without
> needing to specify it in the schema.xml ?
>
> On Thursday 07 January 2016 01:47 PM, Binoy Dalal wrote:
> > 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
> > here:
> > https://mail-archives.apache.org/mod_mbox/lucene-solr-user/201512.mbox/
> > <CABd%2B1eLgwJf02EbkdN53EsJr76JqDadYri-zf3HpQGTvKOAguA%40mail.gmail.com>
> >
> > On Thu, 7 Jan 2016, 13:16 Pranaya Behera <pranaya.behera@igp.com> wrote:
> >
> >> Hi,
> >>        I have read yonik.com/solr-nested-objects/ 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
> >>
> >> --
> > Regards,
> > Binoy Dalal
> >
>
> --
> Thanks & Regards
> Pranaya Behera
>
> --
Regards,
Binoy Dalal

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