java - Apache Solr DataImportHandler failes trying to index -
i trying index xml files solr 6.2.1 using dataimporthandler.
for purpose have added needed import , requesthandler solrconfig.xml:
<lib dir="${solr.install.dir:../../../..}/contrib/dataimporthandler/lib/" regex=".*\.jar" /> <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-dataimporthandler-.*\.jar" /> <requesthandler name="/dataimport" class="org.apache.solr.handler.dataimport.dataimporthandler" startup="lazy"> <lst name="default"> <str name="config">data-config.xml</str> </lst> </requesthandler>
then wrote data-config.xml , put same path solrconfig.xml:
<dataconfig> <datasource type="filedatasource" encoding="utf-8"/> <document> <entity name="pickupdir" processor="filelistentityprocessor" datasource="null" basedir="/vagrant/trec8all/adhoc/" recursive="true" filename="^[\w\d-]+\.xml$" /> <entity name="trec8_simple" processor="xpathentityprocessor" stream="true" datasource="pickupdir" url="${pickupdir.fileabsolutepath}" foreach="/docs/doc"> <field column="id" xpath="/docs/doc/docno"/> <field column="header" xpath="/docs/doc/header"/> <field column="text" xpath="/docs/doc/text"/> </entity> </document> </dataconfig>
this should make importhandler iterate recursively through xml files in directory , index them according xpaths.
when call requesthandler this: (i running solr in vagrant box instead of locally)
http://192.168.155.156:8983/solr/trec8/dataimport?command=full-import&entity=trec8_simple
i getting exception in solr.log:
error (thread-14) [ x:trec8] o.a.s.h.d.dataimporter full import failed:java.lang.nullpointerexception @ org.apache.solr.handler.dataimport.dataimporter.createpropertywriter(dataimporter.java:325) @ org.apache.solr.handler.dataimport.dataimporter.dofullimport(dataimporter.java:412) @ org.apache.solr.handler.dataimport.dataimporter.runcmd(dataimporter.java:475) @ org.apache.solr.handler.dataimport.dataimporter.lambda$runasync$0(dataimporter.java:458) @ java.lang.thread.run(thread.java:745)
im assuming should source dataimporthandler:
i have trouble figuring out causing exception , meaning. nice if me out. thanks!
edit: think has dataimporthandler not beeing able finde data-config.xml. when remove throw exact same exception
ok found issue! problem in solrconfig,
<lst name="default"> <str name="config">data-config.xml</str> </lst>
should have been
<lst name="defaults"> <str name="config">data-config.xml</str> </lst>
Comments
Post a Comment