es 인덱스 재구성
4170 단어 elaaticsearch
// date ,field dynamic mapping date
PUT /my_index/my_type/10
{
"title" : "2017-01-10"
}
//
GET /my_index/my_type/_search
// ,
PUT /my_index/my_type/2
{
"title" : "my first title"
}
//
PUT /my_index_new
{
"mappings": {
"my_type" : {
"properties": {
"title" : {
"type": "text",
"index": true,
"analyzer": "standard"
}
},
"_source": {
"enabled": true
},
"_all": {
"enabled": true
}
}
}
}
// scoll
GET /my_index/my_type/_search?scroll=1ms
{
"query": {
"match_all": {}
},
"sort": ["_doc"],
"size": 1
}
// bulk , , _bulk
//POST /_bulk
//{
// {"index" : {"_index":"my_index_new", "_type":"my_type", "_id":"5"}},
// {"title" : "2017-01-01"}
//}
//
POST /_bulk
{ "index": { "_index": "my_index_new", "_type": "my_type", "_id": "2" }}
{ "title": "2017-01-02" }
//
GET /my_index_new/my_type/_search
//
POST /_aliases
{
"actions": [
{
"remove": {
"index": "my_index",
"alias": "isgood"
}
},
{
"add": {
"index": "my_index_new",
"alias": "isgood"
}
}
]
}
// , ,
GET /isgood/my_type/_search