首页 文章

查询中的elasticsearch索引

提问于
浏览
1

我是弹性搜索的新手 . 并且无法找出如何在JSON请求中对索引和类型提出正确的请求? (所以我不想在URL中使用索引和类型,如localhost:9200 / myindex / mytype / _search,但要向localhost发出JSON请求:9200 / _search)

我试过这样的事 . 但我得到了'aaa'指数而不是'bbb'指数的结果 . 如何仅从bbb索引获得结果或根本没有结果?

{
  "query": {
    "indices": {
      "indices": [
        "bbb"
      ],
      "query": {
        "bool": {
          "must": [
            {
              "range": {
                "apps.vol": {
                  "lte": 1
                }
              }
            },
            {
              "term": {
                "apps.status": 2
              }
            }
          ],
          "must_not": [],
          "should": []
        }
      }

    }
  }
  ,"size":2,"sort":[],"facets":{}
}

1 回答

相关问题