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"*
*        }*
*    ]*
}

*data-source-config.xml:*
<dataConfig>
<dataSource name="mongod" type="JdbcDataSource"
driver="com.mongodb.jdbc.MongoDriver"
url="mongodb://<<IPAddress>>:<<Port>>/<<DBCollection>>"/>
<document name="products">
<entity name="products"
dataSource="mongod"
transformer="ProdsCatsFieldTransformer,TemplateTransformer"
onError="continue"
pk="uuid"
query="SELECT idStr,sampleAttr,additionalInfo.name,additionalInfo.value
FROM products"
deltaImportQuery="SELECT
idStr,sampleAttr,additionalInfo.name,additionalInfo.value FROM products
WHERE orgidStr = '${dataimporter.request.orgid}' AND idStr =
'${dataimporter.delta.idStr}'"
deltaQuery="SELECT idStr FROM products WHERE orgidStr =
'${dataimporter.request.orgid}' AND updatedAt &gt;
'${dataimporter.last_index_time}'"
>
<field column="idStr" name="prod_idStr"/>
<field column="sampleAttr" name="sampleAttr" />
*<field column="additionalInfo.name" name="additionalInfo.name" />*
* <field column="additionalInfo.value" name="additionalInfo.value" />*
</entity>
</document>
</dataConfig>

*managed-schema.xml:*
<field name="prod_idStr" type="string" indexed="true" stored="true"
required="false"/>
 <field name="sampleAttr" type="string" indexed="true" stored="true" />
 <field name="additionalInfo.name" type="strings" indexed="true"
stored="true" />
 <field name="additionalInfo.value" type="strings" indexed="true"
stored="true" />

What fieldType should I use for JSON Array.?I tried above - "strings"
however it doesn't seem to work.
Can someone help me on this?
Appreciate your response.Thanks.

Reply via email to