Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Beginner's guide to ElasticSearch [closed]

Edit (April 2015):

As many have noticed, my old blog is now defunct. Most of my articles were transferred over to the Elastic blog, and can be found by filtering on my name: https://www.elastic.co/blog/author/zachary-tong

To be perfectly honest, the best source of beginner knowledge is now Elasticsearch - The Definitive Guide written by myself and Clinton Gormley.

It assumes zero search engine knowledge and explains information retrieval first principals in context of Elasticsearch. While the reference docs are all about finding the precise parameter you need, the Guide is a narrative that discusses problems in search and how to solve them.

Best of all, the book is OSS and free (unless you want to buy a paper copy, in which case O'Reilly will happily sell you one :) )

Edit (August 2013):

Many of my articles have been migrated over to the official Elasticsearch blog, as well as new articles that have not been published on my personal site.

Original post:

I've also been frustrated with learning ElasticSearch, having no Lucene/Solr experience. I've been slowly documenting things I've learned at my blog, and have four tutorials written so far:

So I don't have to keep editing, all future tutorials on my blog can be found under this category link.

And these are some links that I have bookmarked, because they have been incredibly helpful in one way or another:

  • Thinking through and debugging problems with your query
  • Another example of complicated mapping (ngram, synonyms, phonemes)
  • Searching parts of a word
  • Fun with ElasticSearch's children and nested documents

You can Learn the overview using this link

http://spinscale.github.com/elasticsearch/2012-03-jugm.html#/1


I found Elastic Search one of the hardest things I've had to learn, I hadn't used Lucene before and I found the documentation to be quite hard to follow.

These are the things that I wish I'd known before I started learning it:

Configuration and setup

I configured ELS to run on 3 VM' using Centos, Mint and Ubuntu. Centos was by far the best choice of the three.

I followed this guide to help me set it up (it worked fine on all three distros)

Index and types

One Index can contain many types, it's by using types that you can achieve a good degree of separation of data that belongs within the same index.

PHP

I use PHP as a front end and used this wrapper to integrate my ELS installation into my scripts.

Other resources

The presentation in the other answer to your question is really good, go through it and learn the DSL Query syntax, once setup this is where the real power of ELS comes into its own.


If you're new to elasticsearch and the “information retrieval” / “fulltext search” in general, my advice would be to check these resources first, before trying out tutorials on specific features:

  • The Your Data, Your Search, ElasticSearch presentation from EURUKO 2011
  • The ElasticSearch - A Distributed Search Engine talk by Shay Bannon together with accompanying scripts
  • The Lucene in Action book (at least the general chapters on the indexing, analysis, tokenization, and constructing queries)