Using Solr with MySQL

£可爱£侵袭症+ 提交于 2019-12-21 03:45:32

问题


I was browsing some questions here concerning MySQL and faceted searches and I saw one response that suggested the use of Solr.

In my MySQL database, I have many tables for products, suppliers, messages, users, etc - all interconnected. How would I use Solr to do faceted searches for products? From what I understand, I'd have to keep feeding Solr product data from MySQL - but how do I deal with indexing the data? Do index right after adding a new product? Do I batch index? How do I deal with Solr accurately representing data that is found in my MySQL database? (inserts, deletes, etc)

Thanks in advance.


回答1:


Take a look at data import handler. Apart from batch update you can also trigger update by calling update request handler. You would have to call it from your application but you can also create your own custom update request handler that would fit your needs.




回答2:


If using data import handler, use the delta import command.




回答3:


SOLR is a JAVA application but you can access it using any language that provides HTTP GET/POST functionality.

for your need you should refer to http://wiki.apache.org/solr/DataImportHandler but before jumping on the Indexing part go through the tutorial at lucene.apache.org /solr /tutorial.html



来源:https://stackoverflow.com/questions/4604393/using-solr-with-mysql

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!