专栏名称: YG_9013
目录
相关文章推荐
畅赏黑龙江  ·  在黑龙江的浪花中开启夏日清凉! ·  昨天  
畅赏黑龙江  ·  在黑龙江的浪花中开启夏日清凉! ·  昨天  
哈尔滨日报  ·  南航飞行员实名举报领导,官方通报详情 ·  昨天  
51好读  ›  专栏  ›  YG_9013

ES 查询优化(一)

YG_9013  · 简书  ·  · 2017-12-13 14:51

正文

请到「今天看啥」查看全文


GET /my_index/my_type/_search
{
    "bool": {
        "must": {
            "term": {
                "name": "dev"
            }
        },
        "filter": [
        {
            "term": {
                "type": "ford"
            }
        },
        {
            "term": {
                "color": "yellow"
            }
        }]
    }
}

3、如果对查出的数据的顺序没有要求,则可按照_doc排序,取数据时按照插入的顺序返回。

_doc has no real use-case besides being the most efficient sort order. So if you don’t care about the order in which documents are returned, then you should sort by _doc. This especially helps when scrolling. _doc to sort by index order.







请到「今天看啥」查看全文