简体   繁体   English

SOLR增量导入时间戳记问题

[英]SOLR delta-import timestamp issue

I'm new to SOLR and was doing some research on this technology. 我是SOLR的新手,正在对该技术进行一些研究。 I now have a question regarding the delta-import function so I looked on SO and found this: Solr DataImportHandler delta import . 我现在有一个关于delta-import函数的问题,因此我查看了SO并发现了这一点: 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]字段,它似乎是记录的时间戳。

My question is: Is [date_update] a timestamp stored in the table on record creation? 我的问题是:[date_update]是记录创建时存储在表中的时间戳吗? 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? 如果是这样,如果数据库服务器的日期与安装SOLR的服务器的日期不完全同步,这是否会造成问题? This could possible leave out some records if the Solr server time is ahead of SQLServer time. 如果Solr服务器时间早于SQLServer时间,则可能会遗漏一些记录。

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. 当项目以任何方式更改时,数据库中的项目都会更新时间戳字段。

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获取了最后一个时间戳(存储了该字段),然后将索引查询中的这个时间戳传递给了Solr(/?command = full-import&clean = false&timestamp = ...)。

Using query attribute for both full and delta import 使用查询属性进行完全导入和增量导入

That way time on Solr machine have nothing to do with the time on DB machine. 这样,Solr机器上的时间与DB机器上的时间无关。 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). 但是,就我而言,在完成索引编制后,我将使用数据库执行快速验证(检查由于某种原因缺少任何内容,或者必须删除某些内容)。

You can also use that kind of verification when you use dataimporter.last_index_time. 使用dataimporter.last_index_time时,也可以使用这种验证。

You could use FlexCDC, which monitors the MySQL binary log for table data changes: 您可以使用FlexCDC,它监视MySQL二进制日志中表数据的更改:

http://www.mysqlperformanceblog.com/2011/03/25/using-flexviews-part-two-change-data-capture/ http://www.mysqlperformanceblog.com/2011/03/25/using-flexviews-part-two-change-data-capture/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM