SOLR 增量导入时间戳问题

发布于 2024-12-23 04:24:04 字数 390 浏览 4 评论 0原文

我是 SOLR 的新手,正在对这项技术进行一些研究。我现在有一个关于 delta-import 函数的问题,所以我查看了一下,发现了这个: Solr DataImportHandler delta import 。在答案中提到了一个字段[date_update],它似乎是记录的时间戳。

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

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.

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

踏月而来 2024-12-30 04:24:04

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

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

在更新索引之前,我从 Solr 获取最后一个时间戳(该字段已存储),然后我将索引查询中的这个时间戳传递给 Solr (/?command=full-import&clean=false×tamp=...)。

使用查询属性进行完整导入和增量导入

这样,Solr 机器上的时间与数据库机器上的时间。然而,就我而言,索引完成后,我正在使用数据库执行快速验证(检查是否由于某种原因丢失了任何内容,或者必须删除某些内容)。

当您使用 dataimporter.last_index_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.

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×tamp=...).

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. 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.

ι不睡觉的鱼゛ 2024-12-30 04:24:04

您可以使用 FlexCDC,它监视 MySQL 二进制日志中的表数据更改:

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

You could use FlexCDC, which monitors the MySQL binary log for table data changes:

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文