POC on Elastic Search – with CouchDB & jQuery Autocomplete

Recently I try to search some code in Github and I noted from the blog the engine behind is ElasticSearch (One interesting thing is its detailed & technical explanation for its recent outage)

Elastic Search – From the official site

We want our search solution to be fast, we want a painless setup and a completely free search schema, we want to be able to index data simply using JSON over HTTP, we want our search server to be always available, we want to be able to start with one machine and scale to hundreds, we want real-time search, we want simple multi-tenancy, and we want a solution that is built for the cloud.

Elastic Search is based on Lucene (so far I dont find any non-open source popular search engine use other indexer). Therefore its position is somewhat close to Apache Solr. So some Discussions for “elastic search vs Solr” and I recommend this deep review

I just tried to setup elastic search with my couchDB applicaiton, that really just took me 20minutes. Following the official guide will be very useful.

CouchDB and Elastic Search is definitely a good fit. CouchDB use JSON to store the document, while Elastic Search is able to render the document fields itself – so basically the whole couchDB document can be put into the index / as retrieved document.

That also means code– javascript that handle such JSON objects can be possibly reused.

(While I believe search should not replace couchDB’s native rendering in basic use cases, for it is faster and sorted etc.)

This is also an event-driven-model.  With the River concept, and the stream _change couchDB provides,  changes will be submitted to the Elastic Search and for indexing. Convention over configuration, no explicit setup of filtering or other things it just works. Percolation is a very interesting feature that one can register queries against index and send percolate requests with document and get back which queries are matched.

On the other hand, I spent more time to get the search UI working. The place I look for insights is definitely the ElasticSearch site itself, which is based on jQuery UI autocomplete. Quite nice combination, while one need to get familiar with the API / css. This Plugin is also needed to render generated HTML correctly

Luckily I get to know this at the right time. Originally I did not intend to add search feature to this application at the moment, this is more for POC. I am really considering to use Elastic Search instead of Solr for my cross platform search application. Most interesting part is its replication model, as I want to put the index around, secondly is the JSON REST API, as I would like to use javascript for cross platform UI.  While I need to dive in more for the indexing part.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s