I'm trying to create an index which is going to have a common structure every time it'll be recreated. I've created a template on ES and want to use it while creating and populating the index via Java program. How can an index template be used while creating an index from Java API.
Index template
PUT _template/quick-search
{
"index_patterns": ["quick-search*"],
"settings": {
"number_of_shards": 1
},
"mappings": {
"_source": {
"enabled": false
},
"properties": {
"item" : {
"type" : "long"
},
"description" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"id" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
}
}
}
}