媴媴知识

Elasticsearch 入门(二)

2017-09-13  本文已影响41人  尼罗河上的小杀手

零、Basic Concept

“Relational DB -> Databases -> Tables -> Rows -> Columns
Elasticsearch -> Indices -> Types -> Documents -> Fields”

一、Elasticsearch 搜索初识

$ curl -XGET 'localhost:9200/accounts/post/_search?pretty'
$ curl -XGET 'localhost:9200/accounts/post/_search?q=tag:elasticsearch'
curl -XGET 'localhost:9200/megacorp/employee/_search?pretty' -H 'Content-Type: application/json' -d'
{
    "query" : {
        "match" : {
            "tag" : "elasticsearch"
        }
    }
}
'

二、分布式(cluster, node, shared)

curl -XGET 'localhost:9200/_cluster/health?pretty'

三、参考链接

[ElasticSearch 官方网站](https://www.elastic.co/guide/en/elasticsearch/reference/current/getting-started.html

上一篇下一篇

猜你喜欢

热点阅读