rodesousa
8/27/2015 - 8:58 AM

Command ES !

Command ES !

Le changement de la réplication des shards existants a été changé de 1 à 0 via la commande

curl -XPUT "http://localhost:9200/*/_settings" -d '{ "index" : {"number_of_replicas": 0 } }'

status

curl -XGET 'http://localhost:9200/_cluster/health?pretty=true'

info of all index

curl -XGET http://localhost:9200/_cat/shards

Forcer la realocation

for shard in $(curl -XGET http://localhost:9200/_cat/shards | grep UNASSIGNED | awk '{print $2}'); do
    curl -XPOST 'localhost:9200/_cluster/reroute' -d '{
        "commands" : [ {
              "allocate" : {
                  "index" : "NOM DE INDEX", 
                  "shard" : $shard, 
                  "node" : "NOM D'UN DES NODES DU CLUSTER", 
                  "allow_primary" : true
              }
            }
        ]
    }'
    sleep 5
done

delete index

curl -XDELETE 'http://localhost:9200/twitter/'

Recherche index

curl -XGET 'http://localhost:9200/INDEX/_search?q=CHAMPS:'

pour es 2.X

network:
  host: 0.0.0.0

analyzer un pattern

https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-analyze.html

curl -XGET http://localhost:9200/inde/_xanalyze -d '{"text": "manageur"}'