Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Im trying to add some full text searching to my LAMP web application. Ive come across ElasticSearch and I like what it has to offer. I have read the guides and understand how to index a single item by using curl -XPUT http://localhost:9200/.

But how can I index an entire MySQL database? I cannot seem to find anywhere on the web that explains how to do this. Any ideas?

share|improve this question
up vote 5 down vote accepted

You have to mirror the parts you want searched in elastic search.. you just don't tell elastic search to index a mysql database.

Basically whatever gets put/changed/deleted in mysql also has to do the same in elastic search. You don't have to put all the info just what you want to search on and a way to link it to the mysql info.

share|improve this answer

You can use a river to pull data from your MySQL database.

GitHub: elasticsearch-river-jdbc

Installation instructions

But I've seen more recommendations to have your app push the data using bulk operations.

StackOverflow: How to index JSON web services into elasticsearch?

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.