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"
      }
    }
  ]
}
posted on 2018-04-12 21:16 yangjingzhi 阅读(3755) 评论(0) 收藏 举报
 
                    
                 
                
            
         
 浙公网安备 33010602011771号
浙公网安备 33010602011771号