MySQL更新后触发SOLR更新

2021-12-30 00:00:00 database solr php mysql

我打算使用 SOLR 进行全文搜索.问题:当我更新我的 MySQL 数据库时,有没有什么方法可以在我更新我的数据库后触发 SOLR 更新,从而使 My​​SQL 和 SOLR 中的数据完全相同?数据导入处理器?还是更新处理器?我正在使用 PHP,有时大约 100 次插入/更新/删除查询/分钟(并非总是如此).

I'm planning to use SOLR for full-text search. Question: when I update my MySQL-database, is there any way to trigger a SOLR-update after I updated my database, so the data will be exactly the same in both MySQL and SOLR? DataImportHandler? Or UpdateHandler? I'm using PHP, and sometimes about 100 insert/update/delete-queries/minute (not always).

推荐答案

要么在更新数据库时调用 Solr 从 PHP 更新数据,要么设置 cron 作业这样做.

Either you call Solr to update data from PHP when you are updating DB or you can set up the cron job do do so.

他们计划添加调度程序 do Solr:http://wiki.apache.org/solr/DataImportHandler#Scheduling

They are planning to add scheduler do Solr: http://wiki.apache.org/solr/DataImportHandler#Scheduling

相关文章