1. What is Elasticsearch
Elasticsearch is an open source real-time distributed search and analysis engine based on Apche Lucene.
2. Installation
The only requirement to install Elasticsearch is to install the official version of Java, address: www.java.com
Download the latest version of Elasticsearch in Elasticsearch.org/download.
3. Running
./bin/elastichsearch-d (-d parameter run for daemon mode)
Curl ' Http://localhost:9200/?pretty ' can see the status200 information, stating that Elasticsearch is up and running properly.
4.JSON
Elasticsearch uses JavaScript Object notation (JavaScript Notation) as the document serialization format.
5. Insert an employee data
Curl-xput ' LOCALHOST:9200/MEGACORP/EMPLOYEE/1 '-d '
{
"First_Name": "John",
"Last_Name": "Smith",
"Age": 25,
"About": "I love to go rock climbing",
"Interests": ["Sports", "music"]
}
‘
6. Retrieving documents (you can search for documents based on their IDs)
Curl-xget ' LOCALHOST:9200/MEGACORP/EMPLOYEE/1 '
7. Simple search (the first 10 search results are returned by default)
Curl-xget ' Localhost:9200/megacorp/employee/_search '
8. Passing Simple parameters
Curl-xget ' Localhost:9200/megacorp/employee/_search?q=last_name:smith '
An Introduction to Elasticsearch learning