2017-02-11 2 views
0

je tente d'accéder 10 du terme le plus courant dans mon index en faisant:ElasticSearch: trop de tessons

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

Mais je reçois l'erreur suivante:

{ 
    "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." 
    } 

Le problème est que je n'a pas configuré autant de fragment. Dans mon index, je n'ai qu'un seul fragment défini dans mes paramètres:

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

D'où cette erreur provient-elle? Comment puis-je réduire mon nombre de fragments?

+2

Il suffit d'ajouter le nom d'index avant '_search' comme'/my_index/_search' sinon vous êtes à la recherche sur tous les indices – Val

Répondre

1

Si vous CURIOS sur ce que sont tessons ne vous pouvez utiliser l'api de chat:

GET /_cat/shards 
+0

Tous sauf 2 sont non assignés comment puis-je les terminer? – mel

+0

Vous ne pouvez pas supprimer les fragments, mais seulement les index. Vous pouvez supprimer l'index entier par: DELETE/indexName – MosheZada