curl -XPUT 127.0.0.1:9200/l?pretty -d '
{
"settings" : {
"index" : {
"number_of_shards" : 4 ,
"number_of_replicas" : 0
},
"analysis": {
"analyzer": {
"semicolon_analyzer": {
"tokenizer": "semicolon_tokenizer"
}
},
"tokenizer": {
"semicolon_tokenizer": {
"type": "pattern",
"pattern": ";"
}
}
}
},
"mappings" : {
"l" : {
"properties" : {
"category" : {
"type" : "string",
"index" : "not_analyzed"
},
"bdb_id" : {
"type" : "string",
"index" : "not_analyzed"
},
"article_id" : {
"type" : "string",
"index" : "not_analyzed"
},
"title" : {
"type" : "string",
"index" : "analyzed",
"analyzer" : "ik_smart",
"search_analyzer" : "ik_max_word"
},
"authors" : {
"type" : "string",
"index" : "analyzed",
"analyzer" : "semicolon_analyzer",
"search_analyzer" : "semicolon_analyzer"
},
"keywords" : {
"type" : "string",
"index" : "analyzed",
"analyzer" : "semicolon_analyzer",
"search_analyzer" : "semicolon_analyzer"
},
"keywords_by_machine" : {
"type" : "string",
"index" : "analyzed",
"analyzer" : "semicolon_analyzer",
"search_analyzer" : "semicolon_analyzer"
},
"description" : {
"type" : "string",
"index" : "analyzed",
"analyzer" : "ik_smart",
"search_analyzer" : "ik_max_word"
},
"parent_id" : {
"type" : "string",
"index" : "not_analyzed"
},
"has_original_doc" : {
"type" : "long"
},
"year" : {
"type" : "long"
}
}
}
}
}'
curl -XPOST 'localhost:9200/_cluster/reroute?pretty' -H 'Content-Type: application/json' -d'
{
"commands" : [
{
"allocate_empty_primary" : {
"index" : "l", "shard" : 0,
"node" : "node-main"
}
},{
"allocate_empty_primary" : {
"index" : "l", "shard" : 1,
"node" : "node-main"
}
},{
"allocate_empty_primary" : {
"index" : "l", "shard" : 2,
"node" : "node-main"
}
},{
"allocate_empty_primary" : {
"index" : "l", "shard" : 3,
"node" : "node-main"
}
}
]
}
'