Elasticsearch search api and DSL

作者: wundead | 来源:发表于2016-02-22 23:13 被阅读668次

Why am I writing this shit, beacause the official documentation really really sucks, though you might find this article about es search api and query dsl sucks more.

Elasticsearch可以通过search api提供对文档的精细检索。Elasticsearch的search api对文档的精细检索主要靠Elasticsearch的DSL检索语言实现,它通过自身的query参数指定具体的DSL查询语句。

    curl -XGET 'http://host:port/index/doc/_search' -d ' {   # request body
        ... 
        "query": {DSL_QUERY_CLAUSE}                          # query 参数
        ...
    }'
  • DSL语法
    DSL_QUERY_CLAUSE: 
    {
        QUERY_NAME: 
        {
            FIELD_NAME: 
            {
                ARGUMENT: VALUE,
                ARGUMENT: VALUE
               ...
            }
        }
    }

相关文章

网友评论

    本文标题:Elasticsearch search api and DSL

    本文链接:https://www.haomeiwen.com/subject/quubkttx.html