May 25, 2017

How to Install ElasticSearch on Windows

ElasticSearch Logo

In this tutorial we show you the ElasticSearch installation process on Windows. ElasticSearch is a distributed, RESTful, open source search server, based on Apache Lucene and developed in Java. We are using the Unix-like environment and command-line interface Cygwin to execute ElasticSearch commands on Windows.

Install Cygwin

With the following instructions you will install Cygwin on Windows.

  • Download Cygiwn from Cygwin.
  • Run the setup.exe and press Next.
  • Choose Install from Internet and press Next.
  • Set the root directory, for example C:\cygwin and press Next.
  • Set the local package directory where all downloaded files will be stored and press Next.
  • Select your internet connection and press Next
  • Select any mirror and watch the installation process.
  • Now install these programs: cygutils (Utils), vim (Editors), openssh, openssl, inetutils (Net), curl (Libs, Net, Web), unzip (Archives) and press Next.
  • After the installation press Finish

Install and run ElasticSearch

With the following instructions you will install ElasticSearch on Windows.

  • Download ElasticSearch from the official page.
  • Unzip the package using Windows or archiver software like winzip, winrar etc. or use the Cygwin command unzip.
  • Run C:/(installation folder)/bin/elasticsearch.bat from your Windows command line.
  • Run Cygwin (Menu Start > All Proograms > Cygwin > Cygwin Bash Shell)
  • Execute curl -X GET http://localhost:9200/ within the Cygwin bash shell.

ElasticSearch example

Here is an example to put new data in ElasticSearch.

curl -XPUT 'http://localhost:9200/website/user/john' -d '{ "name" : "John Doe" , "usertype" : "Unknown" }'

The respond should look like:

{"ok":true,"_index":"website","_type":"user","_id":"john"}

Read more at: ElasticSearch

Comments

  1. Very informative Moe , There is a typo it seems . unzip(Archives) is the the one to use not uzip.

  2. Very helpful, thanks !

  3. Muhammad Ilyas says:

    I installed elastic search engine setup locally and used XPUT or some other commands successfully. Now the problem is, how can i search documents/contents which are placed in my PC using elastic search engine??

  4. Thank you thank you thank you very much….

Speak Your Mind