简体   繁体   English

Elasticsearch或Solr + Mysql表搜索

[英]Elasticsearch or Solr + Mysql tables search

I'm a newbie to both Solr & Elasticsearch. 我是Solr和Elasticsearch的新手。 I have a web application written in PHP with MYSQL as DB. 我有一个用PHP和MYSQL作为DB编写的Web应用程序。 I have 5 columns which contains text data. 我有5列包含文本数据。 I want to index and apply search (from Elasticsearch/Solr) on these 5 columns only. 我只想对这5列进行索引并应用搜索(来自Elasticsearch / Solr)。 I did google quite a bit and did not get it. 我做了谷歌很多,没有得到它。

For example : 例如 :

  1. I have 5 columns viz. 我有5栏。 Title, Description, Review, Comments, Others. 标题,说明,评论,评论和其他。
  2. The user visits http://www.my_site.com and enters his/her search query 用户访问http://www.my_site.com并输入他/她的搜索查询
  3. Now I want my application to search all columns as mentioned in 1. and return the result. 现在,我希望我的应用程序搜索1.中提到的所有列并返回结果。

(Mysql supports search across multiple columns, but its not complete and works like "SQL_LIKE". I want a search engine like the one's used in e-commerce sites) (Mysql支持跨多列的搜索,但是它不完整,并且像“ SQL_LIKE”一样工作。我想要一个类似电子商务网站中使用的搜索引擎)

First, you have to index documents (aka rows from your example). 首先,您必须索引文档(示例中的行)。 If your data are in MySQL, I suggest that you use : 如果您的数据在MySQL中,建议您使用:

Launch Elasticsearch, Add the river, and start to search. 启动Elasticsearch,添加河流,然后开始搜索。

You can have a look at Elastica for a PHP Client. 您可以查看PHP客户端的Elastica

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

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