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 Sreejith Variyath <sr...@tarams.com> on 2019/07/11 10:33:09 UTC
Indexing nested document: Solr 8.1.1
Hi, I am trying to index a sample nested document in solr. But I am getting
error
"ERROR: [doc=1] multiple values encountered for non multiValued field
_childDocuments_.id: [2, 3]"
I am using ClassicIndexSchemaFactory. So I have defined all the fields in
schema.xml. Below my field settings in schema.xml.
*<!-- for nested documents (minimal; points to root document) --><field
name="_root_" type="string" indexed="true" stored="false" docValues="false"
/> <!-- for nested documents (relationship tracking) --><field
name="_nest_path_" type="_nest_path_" /><fieldType name="_nest_path_"
class="solr.NestPathField" /> <field name="id" type="string" indexed="true"
stored="true" required="true" multiValued="false" /><field name="title"
type="string" indexed="true" stored="true" required="false"/> <field
name="content_type" type="string" indexed="true" stored="true"
required="false"/> <field name="_childDocuments_" type="string"
indexed="true" stored="true" required="false" multiValued="true"/> <field
name="_childDocuments_.id" type="string" indexed="true" stored="true"
required="false"/> <field name="_childDocuments_.comments" type="string"
indexed="true" stored="true" required="false"/> <dynamicField
name="ignored_*" type="ignored"/> <field name="_version_" type="plong"
indexed="false" stored="false"/>*
Below the json document which I am trying to index.
{ "id": "1",
"title": "Solr adds block join support",
"content_type": "parentDocument",
"_childDocuments_": [{
"id": "2",
"comments": "SolrCloud supports it too!"
},
{
"id": "3",
"comments": "SolrCloud supports it too!3"
}]
}
Could some one please help me to figure out the issues ?. Do I need to make
the inner fields *multiValued="true" ?*
--
Best Regards,
*Sreejith *
--
w: www.tarams.com <https://www.tarams.com/>
<https://www.linkedin.com/company/tarams-software/>
<https://www.facebook.com/TaramsTech/> <https://twitter.com/taramstech>
=============================
DISCLAIMER:
The information in this message
is confidential and may be legally
privileged. It is intended solely for
the addressee. Access to this
message by anyone else is unauthorized. If
you are not the intended
recipient, any disclosure, copying, or
distribution of the message, or
any action or omission taken by you in
reliance on it, is prohibited and
may be unlawful. Please immediately
contact the sender if you have
received this message in error. Further,
this e-mail may contain viruses
and all reasonable precaution to minimize
the risk arising there from
is taken by Tarams. Tarams is not liable for
any damage sustained by you
as a result of any virus in this e-mail. All
applicable virus checks
should be carried out by you before opening this
e-mail or any
attachment thereto.
Thank you - Tarams Software Technologies
Pvt.Ltd.
=============================
Re: Indexing nested document: Solr 8.1.1
Posted by "sreejith.variyath" <sr...@tarams.com>.
Hi, I was using the url
*http://localhost:8983/solr/my-core/update/json/docs*. It was wrong. I
should use *http://localhost:8983/solr/my-core/update* and its worked.
Thanks
--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html