When I ru开发者_如何转开发n full_import command it is working fine. The updated dates are written to dataimport.properties file. When I run delta-import it is giving Indexing failed. Rolled back all changes.. The dataimport.properties file was already created and have the 777 permissions in solr/conf/ location.
Please Help me to solve this problem.
@mbonaci
the query,deltaImportQuery and deltaQuery in data-config.xml is as follows
<entity name="item" query="select group_title,description,DATE_FORMAT(created_date, '%Y-%m-%dT%H:%i:%sZ') as createdDate,group_status, 'GROUP' as itemtype,group_id as id from collaboration_groups where group_status=1"
deltaImportQuery="select group_title,description,DATE_FORMAT(created_date, '%Y-%m-%dT%H:%i:%sZ') as createdDate,group_status,group_id as id,'GROUP' as itemtype from collaboration_groups where group_status=1 and group_id=${dataimporter.delta.id} "
deltaQuery="select group_id from collaboration_groups where group_status=1 and updated_date > '${dataimporter.last_index_time}'" deletedPkQuery="select group_id from collaboration_groups where group_status = 0 and updated_date > '${dataimporter.last_index_time}'">
<field column="id" name="id" />
<field column="itemtype" name="itemtype" />
<field column="group_title" name="fullName" />
<field column="description" name="description"/>
<field column="createdDate" name="createdDate"/>
</entity>
the config parameter of the dataImport request handler in config.xml is as follows
<requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler">
<lst name="defaults">
<str name="config">/var/solr/data-config.xml</str>
</lst>
</requestHandler>
I noticed that, in your deltaImportQuery
you referenced id
(which doesn't exist in your deltaQuery) instead of group_id
. In this line:
...and group_id=${dataimporter.delta.id}"
Since your PK in deltaQuery is group_id, that part of query should go like this:
...and group_id=${dataimporter.delta.group_id}"
I had that same problem, cuz' I did not understand that ${dataimporter.delta}
in fact represents deltaQuery
.
Can you look at your dataConfig
file and post your query
, deltaImportQuery
and deltaQuery
?
dataConfig
is located either directly in your solrconfig.xml
, inside dataImport request handler tag or it's in separate xml file. To find out which file check out config parameter of the dataImport request handler, which is supposed to look similar to this:
<requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler">
<lst name="defaults">
<str name="config">mssql-jdbc.xml</str>
</lst>
</requestHandler>
The file containing dataConfig
is located in the same directory as solrconfig.xml (conf).
精彩评论