hivefans
12/1/2015 - 6:03 AM

Increase Indexing Performance - Elasticsearch

Increase Indexing Performance - Elasticsearch

#!/bin/bash

#Close index
curl -XPOST "localhost:9200/$1/_close"


#refresh rate
curl -XPUT "localhost:9200/$1/_settings" -d '{
    "index" : {
        "refresh_interval" :-1
    }
}'

#merge policy
curl -XPUT "localhost:9200/$1/_settings" -d '{
    "index" : {
        "index.merge.policy.merge_factor" : 30
    }
}'

#replicas
curl -XPUT "localhost:9200/$1/_settings" -d '{
    "index" : {
        "number_of_replicas" : 0 
    } 
}'

#flush
curl -XPUT "localhost:9200/$1/_settings" -d '{
"index":{
"index.translog.flush_threshold_size":10000
}
}'

#buffer
curl -XPUT "localhost:9200/$1/_settings" -d '{
"index":{
"indices.memory.index_buffer_size": 30
}
}'

curl -XPOST "localhost:9200/$1/_open"