简体   繁体   中英

Elasticsearch or Solr + Mysql tables search

I'm a newbie to both Solr & Elasticsearch. I have a web application written in PHP with MYSQL as DB. I have 5 columns which contains text data. I want to index and apply search (from Elasticsearch/Solr) on these 5 columns only. I did google quite a bit and did not get it.

For example :

  1. I have 5 columns viz. Title, Description, Review, Comments, Others.
  2. The user visits http://www.my_site.com and enters his/her search query
  3. Now I want my application to search all columns as mentioned in 1. and return the result.

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

First, you have to index documents (aka rows from your example). If your data are in MySQL, I suggest that you use :

Launch Elasticsearch, Add the river, and start to search.

You can have a look at Elastica for a PHP Client.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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