Highly scalable, real-time search, distributed and analytics open source search engine build on top of Lucene and is natively JSON + REST API. In this tutorial we’ll look at some of the key concepts when getting started with Elasticsearch [ES].
|Based on Lucene|
|Runs on the JVM|
|Distributed: Cluster, fail over, replication, and master election out of the box|
|Schema less: document based, automated type mapping, JSON|
Downloading and running ElasticSearch [ES]
ES can be downloaded packaged in various formats such as ZIP, DEB, RPM and TAR.GZ from elasticsearch.org. After downloading and extracting a package running it couldn’t be much easier, please noted Java runtime must be installed.
Running ElasticSearch on Windows
Navigate to the extracted directory to run ElasticSearch on Windows. We run C:\ELK\elasticsearch-1.4.2\bin\elasticsearch.bat [note this is my ES root directory]. This will start ElasticSearch running in the foreground in the console.
Just two things we have to make sure, one JAVA is installed and second we have a JAVA_HOME environment variable configured correctly.
Let’s test ES is working using browser http://localhost:9200/
If we get status 200 it means – everything is fine.
What’s JSON output tells us?
- Ok: when it’s true, it means that request was successful.
- Status: HTTP error code that resulted from request. 200 means OK.
- Name: name of our ES instance. By default,it assign the node a random name.
- Version: The object here has a number field, which is version of ES we are currently running, and a snapshot_build field, which indicates if what we are running has been built from sources.
- Tagline: Contains first tagline of ES: “You Know, for Search.”
Now let’s install one of the ES plugin viz. ElasticSearch Head from http://mobz.github.io/elasticsearch-head/, this is an optional step.
C:\ELK\elasticsearch-1.4.2\bin>plugin -install mobz/elasticsearch-head
The Head plugin or elasticsearch-head is a web front end for browsing and interacting with an ES cluster. For more details on available plugins refer to the plugin guide.
One more recommended Chrome plugin for quering ES is “Sense”. Sense provides a simple user interface for using ES REST API. It also has a number of features such as autocomplete for ES query syntax and copying & pasting requests in curl format. Below is how to get it.
Below are details on how to query ES using Sense for adding sample data to index.
We can verify data in ES head plugin as shown below.
So now we are ready to play with ES and ready to dive in, for getting more out it.
Now What’s Next?
- Visit elasticsearch.org guide
- You may follow the elasticsearch.org blog
- Tutorials can be found at elasticsearch.org tutorials
- Find ES projects on github
- To use Elasticsearch with Java go to the elasticsearch.org Java API
- Marvel is a visual cluster health and metrics dashboard
- For graphical data analysis check out Kibana
- ES works seamlessly to collect, parse, index, and search logs with Logstash
Lucidworks Spell CorrectionWe need to update few configuration for spell check to work in…
Automatic Phrasing Token Filter in Lucidworks FusionHow do we inject capability to detect and tokenize phrases using Automatic…
Java SE 8 parallelSort in Arrays classArrays class now has several new “parallel” methods to take advantage of…
Bubble Sort Using JAVABubble sort is a simple sorting algorithm that works by repeatedly stepping…