Traditionally, building portals and/or web sites with “search that just works” has been hard but over the last few years, life has become easier. Various search tools such as Lucene and Solr have emerged, and platforms such as Liferay have integrated with them to provide the kind of search capabilities that I and my customers/users expect – fast, east to set up, easy to scale, and easy to find relevant results. Recently I had an opportunity to use elasticsearch instead of Solr or Lucene as the search engine on an enterprise scale portal implementation project with Liferay. This is the first blog post in a series that talks about elasticsearch and how you can integrate it with Liferay.
Elastic Search: A distributed RESTful Search Engine
That’s how they define themselves on their website – www.elasticsearch.com. It was created as a scalable search solution with a common interface, JSON over HTTP, and the first version was released in February 2010.
These are the most important features:
- Based on Apache Lucene, elasticsearch can be used to search all kinds of documents. Lucene’s features are available through the JSON and Java API. It supports faceting that is really useful to use with advanced search systems such as Liferay’s (a really fantastic explanation about that can be found in Ray Auge’s blog), and percolating, which can be useful for notifying users if new documents match for registered queries.
- Open Source, it is stored in GitHub and its latest version can be reached in its repository. There are a lot of clients and integrations available (clients for Groovy, Perl, Python, Java, Ruby, PHP or .Net, among others, and integrations with Jetty, Drupal, Spring or Liferay, among others).
- It is distributed, which means that indices can be divided into shards and each shard can have zero or more replicas. Each node hosts one or more shards, and acts as a coordinator to delegate operations to the correct shard(s). It provides a scalable search solution, has near real-time search and support for multitenancy.
- RESTful, it uses JSON models for representing data. With JSON it is simple to provide semi-structured data with complex entities as well as being programming language neutral with first-level parser support.
Of course, the first thing that comes to mind is, ok, “for Search”, but what can Elastic Search do and how can I compare it to Solr, for example? I am not going to answer this second question because a lot of people has done so before me, but about what Elastic Search can do, I will stop and reply: a lot of things, easily and really fast!!
Explaining every functionality about Elastic Search would be really useful, but if someone has already done so, why do it again? While I have been working with Elastic Search, I found some additional resources really helpful. Here is a list of some of those useful resources:
- Elastic Search Website
- Elastic Search Guide
- Elastic Search code
- A lot of Elastic Search projects:
- Curl, a command line tool for transferring data with URL syntax.
- And, of course, Elastic Search Users, where you can share your experience and get help.
The three most useful Elastic Search vs Solr comparisions:
If you have any question, need help or want to share your impressions, just comment below on this blog post or contact XTIVIA!