简体   繁体   English

使用Solr和经常更新的数据

[英]Using Solr with frequently updated data

I have a site search I would like to implement using Solr. 我有一个网站搜索我想用Solr实现。 Unfortunately, I also have a lot of frequently updated dynamic data in my MySQL database from cron jobs, which I would also like to be searchable. 不幸的是,我在我的MySQL数据库中也有很多经常更新的动态数据来自cron作业,我也希望能够搜索到这些数据。

I would automatically assume that constantly updating records in Solr is not a good idea so is there a workable solution to give me the text-search power of Solr as well as being able to filter based on these frequently updated fields? 我会自动认为不断更新Solr中的记录并不是一个好主意,那么有没有一个可行的解决方案来为我提供Solr的文本搜索功能以及能够根据这些经常更新的字段进行过滤?

I think this depends what "frequently" means and how long your tolerated Solr-lag is. 我认为这取决于“经常”意味着什么以及你容忍的Solr-lag多长时间。

In my case, i update Solr twice every minute, which works fine. 在我的情况下,我每分钟更新Solr两次,这很好。 ..based on an MySql DB with some hundred updates a Minute. ..基于一个MySql数据库,有一百个更新一分钟。

In this situation it's important NOT to run an optimize on every Solr update/commit. 在这种情况下,重要的是不要在每个Solr更新/提交上运行优化。 Better run an optimize every n hoers. 更好地运行优化每个n hoers。 So finally, all the new MySQL stuff will be visible in Solr with max. 最后,所有新的MySQL内容都将在Solr中以最大值显示。 30 sec. 30秒 delay. 延迟。

It depends on your situation if this is acceptable. 如果可以接受,这取决于您的情况。

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

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