I'm creating my index with org.elasticsearch Java API (6.3.0) in the following function:
private void createIndex(String type) throws IOException {
boolean existent =
config.getClient()
.admin()
.indices()
.prepareExists(CommonUtil.indexName(type))
.execute()
.actionGet()
.isExists();if (!existent) { HashMap<String, Object> settings = new HashMap<>(); settings.put("number_of_shards", 1); settings.put("number_of_replicas", 1); String analysis = "{ 'analyzer': { 'case_insensitive_sort': { 'type': 'custom', 'char_filter': [], 'filter': [ 'lowercase' ] } } }"; CreateIndexRequestBuilder cirb = config.getClient() .admin() .indices() .prepareCreate(CommonUtil.indexName(type)) .setSettings(settings); CreateIndexResponse createIndexResponse = cirb.execute().actionGet(); if (createIndexResponse != null && createIndexResponse.isAcknowledged()) { config.getClient() .admin() .indices() .prepareUpdateSettings(CommonUtil.indexName(type)) .setSettings(Settings.builder().put("analysis", analysis)).get(); } else { // Index creation failed } }
}
This return me javax.ejb.EJBException: java.lang.IllegalArgumentException: unknown setting [index.analysis] please check that any required plugins are installed, or check the breaking changes documentation for removed settings. How can I init an analysis to implement case insensitive sort?