solr - delta import handler not working properly -
i followed steps mentioned @: http://wiki.apache.org/solr/dataimporthandler
i tried other solution stackoverflow still not working.
problem is: have configured delta-import handler still every time run it; indexes records db. have 30 records in db. , every time run delta import indexing 30 records. want changed/deleted should indexed.
any quick help/pointer/solution issue appreciated.
data-config.xml
<dataconfig> <datasource type="jdbcdatasource" name="ds-books" driver="com.mysql.jdbc.driver" url="jdbc:mysql://localhost/test" user="root" password=""/> <document name="books"> <entity name="books" pk="id" query="select * books" deltaimportquery="select * books id = '${dataimporter.delta.id}'" deltaquery="select id books last_modified > '${dataimporter.last_index_time}'" > <field column="id" name="id" indexed="true" stored="true"/> <field column="name" name="name" /> <field column="price" name="price" /> <field column="last_modified" name="last_modified" /> </entity> </document> </dataconfig> command using execute is:
http://localhost:8983/solr/dataimport?command=delta-import dataimport.properties file:
fri may 10 17:13:18 ist 2013
last_index_time=2013-05-10 17\:13\:18
books.last_index_time=2013-05-10 17\:13\:18
dataimporter.last_index_time=2013-05-10 17\:11\:42
xml response getting follows:
<response> <lst name="responseheader"> <int name="status">0</int> <int name="qtime">4</int> </lst> <lst name="initargs"> <lst name="defaults"> <str name="config">data-config.xml</str> </lst> </lst> <str name="command">delta-import</str> <str name="status">idle</str> <str name="importresponse"/> <lst name="statusmessages"> <str name="total requests made datasource">1</str> <str name="total rows fetched">30</str> <str name="total documents skipped">0</str> <str name="delta dump started">2013-05-10 17:13:17</str> <str name="identifying delta">2013-05-10 17:13:17</str> <str name="deltas obtained">2013-05-10 17:13:17</str> <str name="building documents">2013-05-10 17:13:17</str> <str name="total changed documents">30</str> <str name="">indexing completed. added/updated: 30 documents. deleted 0 documents.</str> <str name="committed">2013-05-10 17:13:17</str> <str name="total documents processed">30</str> <str name="time taken">0:0:0.303</str></lst> <str name="warning">this response format experimental. change in future.</str> </response> in log file getting following thing:
info: read dataimport.properties may 10, 2013 5:13:18 pm org.apache.solr.handler.dataimport.docbuilder dodelta info: starting delta collection. may 10, 2013 5:13:18 pm org.apache.solr.handler.dataimport.docbuilder collectdelta info: running modifiedrowkey() entity: books may 10, 2013 5:13:18 pm org.apache.solr.handler.dataimport.jdbcdatasource$1 call info: creating connection entity books url: jdbc:mysql://localhost/test may 10, 2013 5:13:18 pm org.apache.solr.handler.dataimport.jdbcdatasource$1 call info: time taken getconnection(): 9 may 10, 2013 5:13:18 pm org.apache.solr.handler.dataimport.docbuilder collectdelta info: completed modifiedrowkey entity: books rows obtained : 30 may 10, 2013 5:13:18 pm org.apache.solr.handler.dataimport.docbuilder collectdelta info: completed deletedrowkey entity: books rows obtained : 0 may 10, 2013 5:13:18 pm org.apache.solr.handler.dataimport.docbuilder collectdelta info: completed parentdeltaquery entity: books may 10, 2013 5:13:18 pm org.apache.solr.handler.dataimport.docbuilder dodelta info: delta import completed may 10, 2013 5:13:18 pm org.apache.solr.handler.dataimport.docbuilder finish info: import completed may 10, 2013 5:13:18 pm org.apache.solr.update.directupdatehandler2 commit info: start commit{flags=0,_version_=0,optimize=false,opensearcher=true,waitsearcher=true,expungedeletes=false,softcommi t=false} may 10, 2013 5:13:18 pm org.apache.solr.core.solrdeletionpolicy oncommit info: solrdeletionpolicy.oncommit: commits:num=2
changing following values in data-config.xml has solved problem
${dih.last_index_time} instead ${dataimporter.last_index_time}
${dih.delta.id} instead ${dataimporter.delta.id} .
i using solr 4.0
Comments
Post a Comment