Importing a JSON file into Elasticsearch


To import a JSON file into Elasticsearch, we will use the elasticdump package. It is a set of import and export tools used for Elasticsearch. It makes it easier to copy, move, and save indexes. To install elasticdump, we will require npm and Node.js as prerequisites. Installation of npm In this section, npm along with … Continue reading Importing a JSON file into Elasticsearch

Some example queries in elasticsearch


Create Index PUT /ecommerce { } GET /ecommerce/_search { "query": { "match_all": {} } } DELETE /ecommerce GEt /_cat/indices?v PUT /ecommerce { "mappings": { "product": { "properties": { "name": { "type": "string" }, "price": { "type": "double" }, "description": { "type": "string" }, "status": { "type": "string" }, "quantity": { "type": "integer" }, "categories": { … Continue reading Some example queries in elasticsearch

Example for ElasticSearch geo distance filter


curl -XDELETE 'http://localhost:9200/twitter/' curl -XPUT 'http://localhost:9200/twitter/' curl -XPUT 'http://localhost:9200/twitter/tweet/_mapping' -d ' { "tweet" : { "properties" : { "locations" : {"type" : "geo_point"} } } }' curl -XPUT 'http://localhost:9200/twitter/tweet/1' -d ' { "user": "kimchy", "postDate": "2009-11-15T13:12:00", "message": "Trying out Elastic Search, so far so good?", "locations" : [{ "lat" : 50.00, "lon" : 10.00 }, … Continue reading Example for ElasticSearch geo distance filter

Beginner’s Guide to ElasticSearch


Introduction Elastic is a search server based on Apache Lucene, and provides a distributable full-text search engine that’s accessible through a restful interface. ElasticSearch is schema-less, and uses JSON instead of XML. It is open-source and built in Java, which means you can run ElasticSearch on any platform, as Java is platform independent. ElasticSearch is … Continue reading Beginner’s Guide to ElasticSearch

ElasticSearch Tutorial: Creating an Index and Querying with Rest Api


Elasticsearch is a highly-scalable document storage engine that specializes in search. Elasticsearch comes with reasonable default settings, but it will also easily scale to being able to search hundreds of millions of documents with sub-second latency. As you’ll see in this tutorial, the JSON-based nature of Elasticsearch, along with its simple REST API, make it … Continue reading ElasticSearch Tutorial: Creating an Index and Querying with Rest Api