Hi,
I did not check it but it seems to me that it might be related to using full
path in your fields xpath: you are iterating hash-es and you should probable
set field paths assuming it is the new root. E.g. for id it would be:
>
HTH,
Emir
--
Monitoring - Log Management - Alerting - Anomaly Detection
Solr & Elasticsearch Consulting Support Training - http://sematext.com/
> On 15 Dec 2017, at 11:07, Triveni wrote:
>
> I am trying to import a nested xml using URLdatasource. But indexing is not
> happening.
> XML:
>
> ABC
> 1512016450886
> XYZ
>
>
> access
> public
>
>
> access12
> public12
>
>
>
>
> My data-config.xml:
>
>
>
>
>url="http://abc:123/api/sample_api.xml;
> processor="XPathEntityProcessor"
> forEach="/hash" >
>
>
> url="http://abc:123/api/sample_api.xml;
> processor="XPathEntityProcessor" forEach="/hash/xyz/xyz"
> transformer="script:f1">
>xpath="/hash/xyz/xyz/name"/>
> xpath="/hash/xyz/xyz/value"/>
>
>
>
>
>
> I am seeing below message when indexing:
> Indexing completed. Added/Updated: 0 documents. Deleted 0 documents.
> Requests: 2 , Fetched: 3 , Skipped: 0 , Processed: 0
> Started: less than a minute ago
>
> And in solr.log file below error:
> 2017-12-15 09:38:53.254 WARN (qtp223684-13) [ x:xml_data]
> o.a.s.h.d.SolrWriter Error creating document : SolrInputDocument(fields:
> [createdBy=XYZ, id=ABC, _version_=1586842286933671936, _root_=ABC],
> children: [SolrInputDocument(fields: [attr.attrValue=public, attr.Id=1,
> attr.attrName=access, _root_=ABC, _version_=1586842286933671936]),
> SolrInputDocument(fields: [attr.attrValue=public12, attr.Id=2,
> attr.attrName=access12, _root_=ABC, _version_=1586842286933671936])])
> org.apache.solr.common.SolrException: [doc=null] missing required field: id
> at
> org.apache.solr.update.DocumentBuilder.toDocument(DocumentBuilder.java:265)
> at
> org.apache.solr.update.DocumentBuilder.toDocument(DocumentBuilder.java:107)
>
>
>
> --
> Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html