Hi,
I am trying to get data import to work with the data source embedded in the
stream of the current request. I've enabled the dataImport request handler in
the solrConfig.xml of the bookClub collection I'm testing this on, and reloaded
the collection.
But I keep running into the error detailed below.
I'm posting the following POST request (in URL encoded format) using an HTTP
client:
________________________________________________________________________________________________________________________________________________________
/solr/bookclub/dataimport?_=1565062909538&indent=on&wt=json&command=full-import&verbose=false&clean=false&commit=true&debug=true&core=bookclub&dataConfig=<dataConfig>
<dataSource name="streamsrc" type="ContentStreamDataSource" loggerLevel="TRACE"
/>
<script><![CDATA[
function execute(row) {
//do something....
}
]]></script>
<document>
<entity
stream="true"
name="streamxml"
datasource="streamsrc1"
processor="XPathEntityProcessor"
rootEntity="true"
forEach="/books/book"
transformer="script:execute" >
<field column="load" template="some static payload"/>
<field column="b_title" xpath="/books/book/name"/>
</entity>
</document>
</dataConfig>&name=dataimport
________________________________________________________________________________________________________________________________________________________
However I'm running into the following in the error log:
________________________________________________________________________________________________________________________________________________________
1186600 [qtp2028017635-21] INFO
org.apache.solr.update.processor.LogUpdateProcessorFactory - [bookclub]
webapp=/solr path=/dataimport
params={core=bookclub&debug=true&indent=on&commit=true&name=dataimport&dataConfig=<dataConfig>%0a<dataSource+name%3D"streamsrc"+type%3D"ContentStreamDataSource"+loggerLevel%3D"TRACE"+/>%0a<script><![CDATA[%0a++++++++++++++++function+execute(row)++++{%0a
;%0a++++++++++++++++}%0a++++++++]]></script>%0a<document>%0a++++<entity%0a++++++++stream%3D"true"%0a++++++++name%3D"streamxml"%0a++++++++datasource%3D"streamsrc1"%0a++++++++processor%3D"XPathEntityProcessor"%0a++++++++rootEntity%3D"true"%0a++++++++forEach%3D"/books/book"%0a++++++++transformer%3D"script:execute"+>%0a++++++++++++</entity>%0a</document>%0a</dataConfig>&clean=false&wt=json&command=full-import&_=1565062909538&verbose=false}{}
0 13
1186601 [qtp2028017635-21] ERROR
org.apache.solr.handler.dataimport.DataImporter - Full Import
failed:java.lang.RuntimeException: java.lang.RuntimeException:
org.apache.solr.handler.dataimport.DataImportHandlerException: No stream
available. The request has no body Processing Document # 1
at
org.apache.solr.handler.dataimport.DocBuilder.execute(DocBuilder.java:271)
at
org.apache.solr.handler.dataimport.DataImporter.doFullImport(DataImporter.java:415)
at
org.apache.solr.handler.dataimport.DataImporter.runCmd(DataImporter.java:474)
at
org.apache.solr.handler.dataimport.DataImportHandler.handleRequestBody(DataImportHandler.java:183)
at
org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:177)
at org.apache.solr.core.SolrCore.execute(SolrCore.java:2503)
________________________________________________________________________________________________________________________________________________________
Would appreciate any suggestions on what I am doing wrong.
Regards,
Piyush.