Elasticsearch:分片太多

Elasticsearch: too many shards

我尝试访问我的索引中最常用的 10 个术语:

POST _search/
{  
  "size":0,
  "aggs":{  
     "top-terms-aggregation":{  
        "terms":{  
           "field":"author_wording",
           "size":10
        }
     }
  }
} 

但我收到以下错误:

{
    "type": "illegal_argument_exception",
    "reason": "Trying to query 1157 shards, which is over the limit of 1000. This limit exists because querying many shards at the same time can make the job of the coordinating node very CPU and/or memory intensive. It is usually a better idea to have a smaller number of larger shards. Update [action.search.shard_count.limit] to a greater value if you really want to query that many shards at the same time."
  }

问题是我没有配置那么多分片。在我的索引中,我的设置中只定义了一个分片:

"index" : {
    "number_of_shards" : 1,
    "number_of_replicas" : 0
 }

这个错误是从哪里来的?如何减少分片数量?

如果你对什么是碎片感到好奇,你可以使用 cat api:

GET /_cat/shards