Skip to content

Instantly share code, notes, and snippets.

@emptyflask
Created August 29, 2013 21:39
Show Gist options
  • Save emptyflask/6383762 to your computer and use it in GitHub Desktop.
Save emptyflask/6383762 to your computer and use it in GitHub Desktop.
# Create ES index
curl -XPUT 'http://search.foo.com:9200/api_master13/' -d '
{
"settings" : {
"number_of_shards" : 5,
"number_of_replicas" : 0
},
"mappings": {
"event": {
"properties": {
"_id": {"type":"string", "index":"not_analyzed"},
"name": {"type":"string"},
"category": {"type":"string", "analyzer":"keyword"},
"event_type": {"type":"string", "analyzer":"keyword"},
"conference": {"type":"string", "index":"not_analyzed"}
}
}
}
}
'
# Create the couchdb river to import data into the index
curl -XPUT 'search.foo.com:9200/_river/api_master13/_meta' -d '{
"type" : "couchdb",
"couchdb" : {
"host" : "couch.foo.com",
"port" : 5984,
"db" : "api_master13",
"filter" : "events"
},
"index" : {
"index" : "api_master13",
"type" : "api_master13",
"bulk_size" : "100",
"bulk_timeout" : "10ms"
}
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment