Elasticsearch入门 互动版

在线工具推荐: Three.js AI纹理开发包 - YOLO合成数据生成器 - GLTF/GLB在线编辑 - 3D模型格式在线转换 - 可编程3D场景编辑器

  查询为twitter,类型为tweet,user为kimch的文档信息。

curl -XGET 'http://localhost:9200/twitter/tweet/_search?q=user:kimchy'

返回结果为:

{
    "_shards":{
        "total" : 5,
        "successful" : 5,
        "failed" : 0
    },
    "hits":{
        "total" : 1,
        "hits" : [
            {
                "_index" : "twitter",
                "_type" : "tweet",
                "_id" : "1",
                "_source" : {
                    "user" : "kimchy",
                    "postDate" : "2015-05-05T14:12:12",
                    "message" : "trying out Elasticsearch"
                }
            }
        ]
    }
}

  _searchURI参数还包括其它一些,如from、size、analyzer、sort、fields、df

查询为twitter,类型为tweet,user为kimch的文档信息。