What is Elastic Search?

Sep 26, 2017 NoSQl
PHP Elastic Search | Learn2torials

Elastic Search is basically no-sql database and can be used for many purpose. It stores data as documents and search operation can be done verity of different ways.

Lets learn it easy way, basically if you know mysql you will have a better understanding of elastic search. MySQL has schemas while elastic search has indexes.

Schema in MySQL has tables while elastic search indexes has types associated with them.

MySQL -> Schema -> Tables ElasticSearch -> Indexes -> Types

How to install Elastic Search in Linux

// install java 7
$ sudo apt-get update;
$ sudo apt-get install openjdk-7-jre;

// download and install elastic search
$ wget https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.7.2.deb;
$ sudo dpkg -i elasticsearch-1.7.2.deb;

// configuration/logs file location
/etc/elasticsearch/logging.yml
/etc/elasticsearch/elasticsearch.yml

// prevent public access
$ sudo nano /etc/elasticsearch/elasticsearch.yml;

// set network.bind_host parameter to
// and save and exit elasticsearch.yml file
network.bind_host: localhost

// check if elastic search is running
$ curl -X GET 'http://localhost:9200';

Now, we have elastic search installed on our linux machine. Next step is to install php plugin for elastic search via composer. Make sure you have composer installed or follow this link to install composer on your linux machine.

// go to root directory of your project
// and run following command to install elastic
// search php plugin for your project
$ composer require elasticsearch/elasticsearch

Good Work, we have installed both elastic search and php plugin. Now time to play with php plugin we just installed. Click on next button to go to next tutorial.

Rate This Article

Elastic search is an open source no-sql database used mostly for full text search feature.

5.00

About Author