Facebooktwittergoogle_plusredditpinterestlinkedinmail

What is Elasticsearch?

Elasticsearch is a search server based on Lucene. It provides a distributed, multitenant-capable full-text search engine with a RESTful web interface and schema-free JSON documents. Elasticsearch is developed in Java and is released as open source under the terms of the Apache License

What is Apache Lucene ?

Apache Lucene is a high-performance, full featured text search engine library written entirely in Java. It is a technology suitable for nearly any application that requires full-text search, especially cross-platform.

Features :

  •     Real time analytics
  •     Distributed
  •     High availability
    • —   Automatic discovery of peers in a cluster
  •     Multi tenant architecture
  •     Full text
  •     Document oriented
  •     Schema free
  •     RESTful API
  •     Per-operation persistence
  •     Easy to extend with a plugin system for new functionality

Terminology:

Elasticsearch terminology with relational database
Elasticsearch terminology with relational database

Document :

In Elasticsearch, everything is stored as a Document. Document can be addressed and retrieved by querying their attributes.

$ curl -XGET http://localhost:9200/gems/document/pry-0.5.9

Document
Document

Shard:

Shard Each Shard is a separate native Lucene Index.

Replica:

An exact copy of primary Shard. Helps in setting up High Availability, increases query throughput.

Index :

ElasticSearch stores its data in logical Indices. Think of a table,collection or a database. •

An Index has at-least 1 primary Shard, and 0 or more Replicas.

Elasticsearch Index
Elasticsearch Index

Cluster :

A collection of cooperating ElasticSearch nodes. Gives better availability and performance via Index Sharding and Replicas.

Installation:

Download and unzip the latest Elasticsearch distribution. You can download from official website  https://www.elastic.co/downloads/elasticsearch

or Linux user can download package using curl

$ curl -L -O https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.4.4.tar.gz

Then extract it as follows (Windows users should unzip the zip package):

  $ tar -xvf elasticsearch-1.4.4.tar.gz

For Unix run OS installation Run

   $ bin/elasticsearch 

For Windows installation Run bin/elasticsearch.bat

Verify Installation:-

Run curl -X GET http://localhost:9200/

Picture4

Note:ElasticSearch is built using Java, and requires at least Java 6 in order to run.

RESTful interface :-

Picture3
How to add Index :-

To index that we decide on an index name (“orders”), a type name (“order”) and an id (“1”) and make a request following the pattern described above with the JSON object in the body.

curl -XPUT "http://localhost:9200/orders/order/1" -d'{
 "product_name": "Product XYZ",
 "prodict_description": "Lorem ispum.....",
 "price": 10001
 }'

The _search endpoint

  • http://serverName:9200/_search

 Search across all indexes and all types.

  • http://serverName:9200/orders/_search

Search across all types in the orders index.

  • http://serverName:9200/orders/order/_search

Search explicitly for documents of type order the orders index

Download :

Getting started with Elasticsearch Roopendra DevOPSElasticsearch,
What is Elasticsearch?Elasticsearch is a search server based on Lucene. It provides a distributed, multitenant-capable full-text search engine with a RESTful web interface and schema-free JSON documents. Elasticsearch is developed in Java and is released as open source under the terms of the Apache LicenseWhat is Apache Lucene ?Apache...
<strong>What is Elasticsearch?</strong>Elasticsearch is a search server based on <a href="http://en.wikipedia.org/wiki/Lucene" target="_blank">Lucene</a>. It provides a distributed, multitenant-capable full-text search engine with a RESTful web interface and schema-free JSON documents. Elasticsearch is developed in Java and is released as open source under the terms of the Apache License<strong>What is Apache Lucene ?</strong>Apache <a href="http://en.wikipedia.org/wiki/Lucene" target="_blank">Lucene </a>is a high-performance, full featured text search engine library written entirely in Java. It is a technology suitable for nearly any application that requires full-text search, especially cross-platform.<strong>Features :</strong> <ul> <li>    Real time analytics</li> <li>    Distributed</li> <li>    High availability <ul> <li>--   Automatic discovery of peers in a cluster</li> </ul> </li> <li>    Multi tenant architecture</li> <li>    Full text</li> <li>    Document oriented</li> <li>    Schema free</li> <li>    RESTful API</li> <li>    Per-operation persistence</li> <li>    Easy to extend with a plugin system for new functionality</li> </ul> <span id="more-101"></span><strong>Terminology:</strong><strong>Document :</strong>In Elasticsearch, everything is stored as a Document. Document can be addressed and retrieved by querying their attributes.$ curl -XGET http://localhost:9200/gems/document/pry-0.5.9<b>Shard</b>:Shard Each Shard is a separate native Lucene Index.<strong>Replica:</strong>An exact copy of primary Shard. Helps in setting up High Availability, increases query throughput.<strong>Index</strong> :ElasticSearch stores its data in logical Indices. Think of a table,collection or a database. •An Index has at-least 1 primary Shard, and 0 or more Replicas.<strong>Cluster :</strong>A collection of cooperating ElasticSearch nodes. Gives better availability and performance via Index Sharding and Replicas. <h3><strong>Installation:</strong></h3> Download and unzip the latest Elasticsearch distribution. You can download from official website <a title="Download Elasticsearch" href="https://www.elastic.co/downloads/elasticsearch" target="_blank"> https://www.elastic.co/downloads/elasticsearch</a>or Linux user can download package using curl <pre>$ curl -L -O https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.4.4.tar.gz</pre> Then extract it as follows (Windows users should unzip the zip package): <pre class="programlisting prettyprint lang-sh prettyprinted"><strong><span class="pln"> $ tar </span><span class="pun">-</span><span class="pln">xvf elasticsearch</span><span class="pun">-</span><span class="lit">1.4</span><span class="pun">.</span><span class="lit">4.tar</span><span class="pun">.</span><span class="pln">gz</span></strong></pre> For Unix run OS installation Run <pre><strong>   $ bin/elasticsearch </strong></pre> For Windows installation Run <strong>bin/elasticsearch.bat</strong><strong>Verify Installation:-</strong>Run <strong>curl -X GET http://localhost:9200/</strong><a href="http://techieroop.com/wp-content/uploads/2014/05/Picture4.png"><img class="alignnone size-medium wp-image-107" src="http://techieroop.com/wp-content/uploads/2014/05/Picture4-300x211.png" alt="Picture4" width="300" height="211" /></a><em>Note:ElasticSearch is built using Java, and requires at least Java 6 in order to run.</em><b>RESTful</b><b> interface</b> :-<a href="http://techieroop.com/wp-content/uploads/2014/05/Picture3.png"><img class="alignnone size-medium wp-image-108" src="http://techieroop.com/wp-content/uploads/2014/05/Picture3-300x110.png" alt="Picture3" width="300" height="110" /></a> <b>How to add Index</b> :-To index that we decide on an index name ("orders"), a type name ("order") and an id ("1") and make a request following the pattern described above with the JSON object in the body. <pre style="padding-left: 30px;">curl -XPUT "http://localhost:9200/orders/order/1" -d'{ "product_name": "Product XYZ", "prodict_description": "Lorem ispum.....", "price": 10001 }'</pre> <strong>The _search endpoint</strong> <ul> <li><b>http://serverName:9200/_search </b>-</li> </ul> <p style="padding-left: 90px;"> Search across all indexes and all types.</p><ul> <li><b>http://</b><b>serverName:9200/orders/_</b><b>search </b>-</li> </ul> <p style="padding-left: 90px;">Search across all types in the orders index.</p><ul> <li><b>http://</b><b>serverName:9200/orders/order</b><b>/_search</b></li> </ul> <p style="padding-left: 90px;">Search explicitly for documents of type order the orders index</p> <strong>Download :</strong><iframe style="border: 1px solid #CCC; border-width: 1px 1px 0; margin-bottom: 5px; max-width: 100%;" src="http://www.slideshare.net/slideshow/embed_code/29877242" width="427" height="356" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" allowfullscreen="allowfullscreen"> </iframe> <div style="margin-bottom: 5px;"><strong> <a title="Elasticsearch Introduction" href="https://www.slideshare.net/roopendravishwakarma/elasticsearch-introdunction" target="_blank">Elasticsearch Introduction</a> </strong> from <strong><a href="http://www.slideshare.net/roopendravishwakarma" target="_blank">Roopendra Vishwakarma</a></strong></div>
(Visited 661 times, 9 visits today)
Facebooktwittergoogle_pluslinkedinrss