简体   繁体   English

Solr在复制的MySQL数据库上搜索

[英]Solr search on a replicated MySQL Database

I want to create a database web publisher. 我想创建一个数据库Web发布者。

Solr search functionnalities suit perfectly to my needs (faceted search, full text search, etc...). Solr搜索功能非常适合我的需求(多面搜索,全文搜索等)。

My problem is that I need data to be synchronised on the net. 我的问题是我需要在网络上同步数据。

I read that MySQL database have to be imported in Solr. 我读到MySQL数据库必须在Solr中导入。

I plan to work with one source MSSQL database, replicated on a MySQL database on a web server. 我计划使用一个源MSSQL数据库,该数据库在Web服务器上的MySQL数据库上复制。 I need to use Solr on this database. 我需要在此数据库上使用Solr。

Is there a solution so that the changes on the replicated SQL database can be automatically echoed on the Solr index? 是否有解决方案,以便可以在Solr索引上自动回显复制的SQL数据库上的更改? I don't want to import the whole database each time it is modified, it would make my product complicated to use. 我不想每次修改时都导入整个数据库,这会使我的产品使用起来很复杂。

Thank you. 谢谢。

you don't need to index the full db each time, that is what Delta import is for. 您不需要每次都索引整个数据库,这就是Delta导入的目的。 You just configure it to import deltas at the times you need. 您只需将其配置为在需要的时间导入增量。

You can use DataImportScheduler to keep your data synchronized. 您可以使用DataImportScheduler保持数据同步。 That's the most common way to keep Solr index in sync. 这是保持Solr索引同步的最常用方法。

There are other ways, you could setup a trigger in your db to fire Solr's REST service that would reflect changes for all inserted/updated/deleted documents. 还有其他方法,您可以在数据库中设置触发器以触发Solr的REST服务,该服务将反映所有插入/更新/删除的文档的更改。

Also, since db is (commonly) used to handle some application, you could setup a Filter (javax.servlet for Java web apps) to intercept requests and push them to Solr before they even reach database. 另外,由于db通常用于处理某些应用程序,因此您可以设置一个Filter(用于Java Web应用程序的javax.servlet)来拦截请求,并将请求推送到Solr,直到它们到达数据库为止。

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

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