trigger SOLR update after MySQL update

2019-02-21 02:59发布

问题:

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

回答1:

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.

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



回答2:

Run a cron job in the background to perform a delta index of the database.