码迷,mamicode.com
首页 > Windows程序 > 详细

ES API

时间:2018-08-03 19:50:14      阅读:865      评论:0      收藏:0      [点我收藏+]

标签:prope   type   视图   ali   ase   twitter   share   active   shard   

create index:
  PUT twitter
    {
        "settings" : {
            "index" : {
                "number_of_shards" : 3, 
                "number_of_replicas" : 2 
            }
        }
    }

Mapping:

  PUT test
    {
        "settings" : {
            "number_of_shards" : 1
        },
        "mappings" : {
            "type1" : {
                "properties" : {
                    "field1" : { "type" : "text" }
                }
            }
        }
    }

Aliases 类似于index的视图

PUT test
{
    "aliases" : {
        "alias_1" : {},
        "alias_2" : {
            "filter" : {
                "term" : {"user" : "kimchy" }
            },
            "routing" : "kimchy"
        }
    }
}

Wait for active shared:


{
    "acknowledged": true,
    "shards_acknowledged": true,
    "index": "test"
}
PUT test
{
    "settings": {
        "index.write.wait_for_active_shards": "2"
    }
}
PUT test?wait_for_active_shards=2

ES API

标签:prope   type   视图   ali   ase   twitter   share   active   shard   

原文地址:http://blog.51cto.com/395469372/2154234

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!