On 4/9/2019 2:04 PM, Abhijit Pawar wrote:
Hello Guys,

I am trying to index a JSON array in one of my collections in mongoDB in
Solr 6.5.0 however it is not getting indexed.

I am using a DataImportHandler for this.

*Here's how the data looks in mongoDB:*
{
  "idStr" : "5ca38e407b154dac08913a96",
     "sampleAttr" : "sampleAttrVal",
*    "additionalInfo" : [ *
*        {*
*            "name" : "Manufacturer",*
*            "value" : "Videocon"*
*        }*
*    ]*
}

That is not a structure that Solr knows how to handle. Essentially what you have there is one document nested inside another. Each of Solr's documents has a completely flat structure -- there is no possibility of a hierarchy within a single document.

Solr does have support for parent/child documents, but it wouldn't be indexed like that. I know almost nothing about how the parent/child document support works. You would have to get help from someone else or consult the documentation.

Thanks,
Shawn

Reply via email to