Skip to content

Instantly share code, notes, and snippets.

@hkulekci
Last active June 20, 2016 08:33
Show Gist options
  • Save hkulekci/2146c1da124e42cd02ed3c4635934f62 to your computer and use it in GitHub Desktop.
Save hkulekci/2146c1da124e42cd02ed3c4635934f62 to your computer and use it in GitHub Desktop.
Sample Data Elasticsearch Aliasing Feature
POST /test
POST /test/test/1
{
"id": 1,
"type": "search",
"keywords": ["elasticsearch", "elastic", "framework"]
}
POST /test/test/2
{
"id": 2,
"type": "search",
"keywords": ["solr", "lucene", "framework"]
}
POST /test/test/3
{
"id": 3,
"type": "search",
"keywords": ["sphinx", "opensource", "framework"]
}
POST /test/test/4
{
"id": 4,
"type": "client",
"keywords": ["golang", "elasticsearch"]
}
POST /test/test/5
{
"id": 5,
"type": "client",
"keywords": ["php", "elasticsearch"]
}
POST /_aliases
{
"actions": [
{
"add": {
"index": "test",
"alias": "test_client",
"filter": {
"term": {
"type": "search"
}
}
}
}
]
}
GET /test/_search
GET /test_client/_search
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment