[英]delta-import problem in solr DIH
When I run full_import command it is working fine. 当我运行full_import命令时,它工作正常。 The updated dates are written to dataimport.properties file. 更新的日期将写入dataimport.properties文件。 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. 回滚所有更改。.dataimport.properties文件已创建,并在solr / conf /位置具有777权限。
Please Help me to solve this problem. 请帮我解决这个问题。
@mbonaci @mbonaci
the query,deltaImportQuery and deltaQuery in data-config.xml is as follows data-config.xml中的查询,deltaImportQuery和deltaQuery如下
<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 config.xml中dataImport请求处理程序的config参数如下
<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
. 我注意到,在您的deltaImportQuery
您引用了id
(在deltaQuery中不存在)而不是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: 由于您在deltaQuery中的PK是group_id,因此该部分查询应如下所示:
...and group_id=${dataimporter.delta.group_id}"
I had that same problem, cuz' I did not understand that ${dataimporter.delta}
in fact represents deltaQuery
. 我有同样的问题,因为我不明白${dataimporter.delta}
实际上代表deltaQuery
。
Can you look at your dataConfig
file and post your query
, deltaImportQuery
and deltaQuery
? 您可以查看dataConfig
文件并发布query
, deltaImportQuery
和deltaQuery
吗?
dataConfig
is located either directly in your solrconfig.xml
, inside dataImport request handler tag or it's in separate xml file. dataConfig
可以直接位于solrconfig.xml
,位于dataImport请求处理程序标记内,也可以位于单独的xml文件中。 To find out which file check out config parameter of the dataImport request handler, which is supposed to look similar to this: 要找出哪个文件,请检查dataImport请求处理程序的config参数,该参数应该看起来与此类似:
<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). 包含dataConfig
的文件与solrconfig.xml(conf)位于同一目录中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.