Hi Team,
We are currently working on 6.3 Version of ES and 6.4v of RestHighLevelClient we are upgrading to ES 8.3v so the code written in earlier version of ES with RestHigh client we are facing challenges to upgrade.
Current ES 8.3 and RestHighClient 7.17.6 we are trying to createIndex with below snippet
private boolean createIndex() throws Exception {
CreateIndexRequest createIndexRequest = new CreateIndexRequest("giftcard_1");
createIndexRequest.settings(PARTIAL_MATCH_INDEX_SETTING, XContentType.JSON);
createIndexRequest.mapping(type, GIFT_CARD_MAPPING, XContentType.JSON);
CreateIndexResponse createIndexResponse = client.indices().create(createIndexRequest, RequestOptions.DEFAULT);
return createIndexResponse.isAcknowledged();
Where the Constants used in Code are
static final String PARTIAL_MATCH_INDEX_SETTING = "{\r\n" +
" "analysis": {\r\n" +
" "analyzer": {\r\n" +
" "partial_search_analyzer": {\r\n" +
" "tokenizer": "partial_tokenizer",\r\n" +
" "filter": [\r\n" +
" "lowercase"\r\n" +
" ]\r\n" +
" }\r\n" +
" },\r\n" +
" "tokenizer": {\r\n" +
" "partial_tokenizer": {\r\n" +
" "type": "edge_ngram",\r\n" +
" "min_gram": 3,\r\n" +
" "max_gram": 3,\r\n" +
" "token_chars": [\r\n" +
" "letter",\r\n" +
" "digit",\r\n" +
" "symbol",\r\n" +
" "punctuation",\r\n" +
" "whitespace"\r\n" +
" ]\n" +
" }\n" +
" }\n" +
" }\n" +
"}";
static final String GIFT_CARD_MAPPING = "{\r\n" +
" "properties": {\r\n" +
" "bhn": {\r\n" +
" "properties": {\r\n" +
" "brandDescription": {\r\n" +
" "properties": {\r\n" +
" "eng": {\r\n" +
" "type": "text",\r\n" +
" "fields": {\r\n" +
" "keyword": {\r\n" +
" "type": "keyword",\r\n" +
" "ignore_above": 256\r\n" +
" }\r\n" +
" },\r\n" +
" "analyzer": "partial_search_analyzer"\r\n" +
" },\r\n" +
" "spa": {\r\n" +
" "type": "text",\r\n" +
" "fields": {\r\n" +
" "keyword": {\r\n" +
" "type": "keyword",\r\n" +
" "ignore_above": 256\r\n" +
" }\r\n" +
" },\r\n" +
" "analyzer": "partial_search_analyzer"\r\n" +
" }\r\n" +
" }\r\n" +
" },\r\n" +
" "brandName": {\r\n" +
" "properties": {\r\n" +
" "eng": {\r\n" +
" "type": "text",\r\n" +
" "fields": {\r\n" +
" "keyword": {\r\n" +
" "type": "keyword",\r\n" +
" "ignore_above": 256\r\n" +
" }\r\n" +
" },\r\n" +
" "analyzer": "partial_search_analyzer"\r\n" +
" },\r\n" +
" "spa": {\r\n" +
" "type": "text",\r\n" +
" "fields": {\r\n" +
" "keyword": {\r\n" +
" "type": "keyword",\r\n" +
" "ignore_above": 256\r\n" +
" }\r\n" +
" },\r\n" +
" "analyzer": "partial_search_analyzer"\r\n" +
" }\r\n" +
" }\r\n" +
" }\r\n" +
" }\r\n" +
" }\r\n" +
" }\r\n" +
"}";
But when we are trying to execute this piece of code snipped we get the below Exception
[________,[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)']:E: 12 08:42:34.032: GCCatalogSchedulerJob.performScheduledJob: Fatal Exception occurred in GCCatalog Scheduler Job : java.lang.Exception: ElasticsearchStatusException[Elasticsearch exception [type=illegal_argument_exception, reason=request [/giftcards_1] contains unrecognized parameter: [include_type_name]]]
[________,[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)']:I: 12 08:42:34.033: GCCatalogSchedulerJob.performScheduledJob: GiftCard get Catalog : Total Time taken to update catalog: 4280
[________,[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)']:I: 12 08:42:34.033: GCCatalogSchedulerJob.performScheduledJob: Giftcard Catalog Scheduler End Date & Time : 01/12/2023 08:42:34
Note the code fails when working with ES 8.3 with RestHighClient 7.17.6 intergration, when i run the above Mappings & Setting defined in constants directly on ES devtools they work FINE(with No ERROR)
Please Assist any help would be Appreciated!!!