简体   繁体   English

如何使用pecl solr扩展连接到mysql?

[英]How to connect to mysql using pecl solr extension?

I am working on PECL Solr extension. 我正在研究PECL Solr扩展。 It is working fine for all the document search and other functionality. 它适用于所有文档搜索和其他功能。 But i want to connect it with mysql db. 但我想将其与mysql db连接。

Please suggest steps to do the same and changes need to be done to implement this. 请建议执行相同操作的步骤,并且需要进行更改以实现此目的。

Thanks 谢谢

Either you'll have to managed the connection to MySQL yourself - as you usually do when you handle data from MySQL. 您要么必须自己管理与MySQL的连接-就像处理MySQL数据时通常所做的那样。 You then retrieve the data through MySQL and submit it to Solr using the Solr extension. 然后,您通过MySQL检索数据,并使用Solr扩展名将其提交给Solr。

The alternative is to use the DataImportHandler in Solr - this is completely separate from the solr pecl extension, as the functionality is built into Solr (and not the extension). 另一种方法是在Solr中使用DataImportHandler-这与solr pecl扩展完全独立,因为该功能内置于Solr中(而不是扩展中)。

The solr extension doesn't have any direct compatibility with MySQL, and is used only to communicate with Solr. solr扩展与MySQL没有任何直接兼容性,仅用于与Solr通信。 You can trigger the data import handler by issuing a single http request with file_get_contents without having to go through the Solr extension. 您可以通过发出带有file_get_contents的单个http请求来触发数据导入处理程序,而不必通过Solr扩展名。

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

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