An Introduction to Elasticsearch learning

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.