elasticsearch 通过别名实现多index查询

GET /firstindex/type/_mapping

PUT /secondindex/type/2
{
"name":"haoxueqing",
"hobby":"sleep"
}

PUT /secondindex


PUT /secondindex/_mapping/type
{
"properties": {
"name":{
"type": "string",
"index": "not_analyzed"
},
"hobby":{
"type": "string",
"index": "not_analyzed"
}
}

}

 

POST /_aliases
{
"actions": [
{
"add": {
"index": "firstindex",
"alias": "my_index_alias"
}
},
{
"add": {
"index": "secondindex",
"alias": "my_index_alias"
}
}
]
}

转载于:https://www.cnblogs.com/yangjingzhi/p/8810490.html

你可能感兴趣的:(elasticsearch 通过别名实现多index查询)