Skip to content

Instantly share code, notes, and snippets.

@karmi
Last active July 19, 2017 08:34
Show Gist options
  • Save karmi/5124043 to your computer and use it in GitHub Desktop.
Save karmi/5124043 to your computer and use it in GitHub Desktop.
An example of request definitions in external files.
{ "index" : { "_index" : "myindex", "_type" : "document", "_id" : "1" } }
{ "title" : "Jumping High" }
{ "index" : { "_index" : "myindex", "_type" : "document", "_id" : "2" } }
{ "title" : "Diving Deeper" }
curl -X DELETE localhost:9200/myindex
curl -X POST localhost:9200/myindex --data @settings.json
curl -X POST localhost:9200/myindex/_bulk?refresh --data-binary @data
curl localhost:9200/myindex/_search?pretty -d '{
"query" : {
"match" : {
"title" : "jump"
}
}
}'
{
"settings" : {
"index" : {
"number_of_shards" : 1
}
},
"mappings" : {
"document" : {
"properties" : {
"title" : {
"type" : "string", "analyzer" : "snowball"
}
}
}
}
}
@sudaraD
Copy link

sudaraD commented Jul 19, 2017

where we store settings.json file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment