I am trying to use Aliases concept in my sample and when I try to query the alias, it throws error:
{
"error": "Incorrect HTTP method for uri [/log] and method [POST], allowed: [DELETE, HEAD, GET, PUT]",
"status": 405
}
PUT {
"template": "log_*",
"aliases": {
"log":{}
}
"settings": {
"index": {
"number_of_shards": 5,
"number_of_replicas": 1
}
}
"mappings": {
"log_event": {
"properties": {
"log_name": {
"type": "string"
},
"log_text": {
"type": "string"
},
"log_data": {
"type": "date"
}
}
}
}
}
POST /log_03012018/_doc/1
{ "log_name": "March 1st 2018",
"log_text": "this is my first doc",
"log_data": "2018-10-10"
}
POST /log_03022018/_doc/1
{ "log_name": "March 2nd 2018",
"log_text": "this is my sec doc",
"log_data": "2019-10-10"
}
POST /log_03032018/_doc/1
{ "log_name": "March 3rd 2018",
"log_text": "this is my sec doc",
"log_data": "2019-10-10"
}
GET log
{
"query":
{ "match_all": {} }
}