Is there java api which can implement this function?
This is a mapping configuration, you have to change the mapping & reindex your datas.
Sorry, I am still confused..How to change mapping and reindex datas? By configuration file, restful api or java transport client?
Both are possible.
You should read:
In Java
try {
String template = FileUtils.readFileToString(new File(jsonTemplateFile));
Client client = ElasticsearchService.getInstance().getClient(documentType);
PutIndexTemplateResponse response = client.admin().indices()
.preparePutTemplate(documentType.getIndexName())
.setSource(template)
.get();
isOk = response.isAcknowledged();
} catch (Exception e) {
logger.severe(ExceptionUtils.getFullStackTrace(e));
}
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.