SOLR增量导入时间戳记问题 [英] SOLR delta-import timestamp issue

查看:308
本文介绍了SOLR增量导入时间戳记问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是SOLR的新手,正在对此技术进行一些研究.我现在有一个关于增量导入功能的问题,所以我看了一下就发现了: Solr DataImportHandler增量导入.答案中提到的字段[date_update]似乎是记录的时间戳.

I'm new to SOLR and was doing some research on this technology. I now have a question regarding the delta-import function so I looked on SO and found this: Solr DataImportHandler delta import. In the answer there is a field [date_update] mentioned which seems to be a timestamp of the record.

我的问题是:[date_update]是在创建记录时存储在表中的时间戳吗?如果是这样,如果数据库服务器的日期与安装SOLR的服务器的日期不完全同步,这是否会造成问题?如果Solr服务器时间早于SQLServer时间,则可能会遗漏一些记录.

My question is: Is [date_update] a timestamp stored in the table on record creation? If so, cannot this create an issues if the date of the Database Server is not exactly in sync with the server on which SOLR is installed? This could possible leave out some records if the Solr server time is ahead of SQLServer time.

推荐答案

此解决方案可能会留下一些记录(如果服务器配置不正确).

This solution might left some records behind (if servers are not configured properly).

我正在使用类似的解决方案,但进行了一些修改.当项目以任何方式更改时,数据库中的项目都有时间戳"字段.

I'm using similar solution but with some modifications. Items in DB have timestamp field updated when item changes in any way.

在更新索引之前,我要从Solr获取上一个时间戳(存储此字段),然后在索引查询中将此时间戳传递给Solr(/?command = full-import& clean = false& timestamp =. ).

Before updating index I'm getting last timestamp from Solr (this field is stored), then I'm passing this timestamp in index query to Solr (/?command=full-import&clean=false&timestamp=...).

对完整导入和增量导入同时使用查询属性

这样,Solr机器上的时间与DB机器上的时间无关.但是,以我为例,在完成索引编制后,我正在使用数据库进行快速验证(检查由于某种原因缺少任何内容,或者必须删除某些内容).

That way time on Solr machine have nothing to do with the time on DB machine. However in my case, after indexing is completed I'm performing quick verification with DB (check is anything missing for some reason, or something have to be deleted).

使用dataimporter.last_index_time时,也可以使用这种验证方式.

You can also use that kind of verification when you use dataimporter.last_index_time.

这篇关于SOLR增量导入时间戳记问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆