Skip to content

Instantly share code, notes, and snippets.

@adkatrit
Last active August 29, 2015 14:02
Show Gist options
  • Save adkatrit/0f94769031d17af1aabd to your computer and use it in GitHub Desktop.
Save adkatrit/0f94769031d17af1aabd to your computer and use it in GitHub Desktop.
if [[ -z "$1" ]];
then $INDEX = $1
else exit 1
fi
#Create index
curl -XPUT "localhost:55559/$INDEX/"
#Close index
curl -XPOST "localhost:55559/$INDEX/_close"
#refresh rate
curl -XPUT "localhost:55559/$INDEX/_settings" -d '{
"index" : {
"refresh_interval" :-1
}
}'
#merge policy
curl -XPUT "localhost:55559/$INDEX/_settings" -d '{
"index" : {
"index.merge.policy.merge_factor" : 30
}
}'
#replicas
curl -XPUT "localhost:55559/$INDEX/_settings" -d '{
"index" : {
"number_of_replicas" : 0
}
}'
#flush -- only necessary for bulk loading
#curl -XPUT "localhost:55559/$INDEX/_settings" -d '{
#"index":{
#"index.translog.flush_threshold_size":10000
#}
#}'
#buffer
curl -XPUT "localhost:55559/$INDEX/_settings" -d '{
"index":{
"indices.memory.index_buffer_size": 30
}
}'
#create the index
curl -XPUT "localhost:55559/$INDEX/_settings" -d '{
"mappings":{
"raw_data":{
"properties":{
"datapath":{
"type":"string",
"index":"not_analyzed"
},
"location":{
"type":"geo-point",
"geohash":true
}
}
}
}
}'
curl -XPOST "localhost:55559/$INDEX/_open"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment