Skip to content

indices client and xcontent/json support #143

@UglyBarnacle

Description

@UglyBarnacle

Hello and I have a question:
I am trying out this new fluent client and have a bunch of projects that I wanted to migrate from the RHLC to the new API client. Now I am kinda stuck on an inconvenient spot, creating an index with settings and mapping. the builder and functional pattern are nice, though in our projects we put json-files for mappings and settings which are read and converted into an object/xContentBuilder so we do not have to implement complex settings/mappings into java code (and reuse without copy paste).

kinda like that

CreateIndexRequest createIndexRequest = new CreateIndexRequest(indexName)
				.settings(this.elasticsearchIndexService.createSettings(ELASTICSEARCH_INDEX_SETTINGS_FILE))
				.mapping(this.elasticsearchIndexService.createMapping(ELASTICSEARCH_INDEX_MAPPING_FILE,
					ELASTICSEARCH_INDEX_MAPPING_FOLDER, shop));
AcknowledgedResponse indexCreateResponse = this.restHighLevelClient.indices().create(createIndexRequest, RequestOptions.DEFAULT);

depending on the shop parameter different mappings are loaded.

Is there a similar and fluent way doing that in the new client or are there any plans supporting json/xcontent?

Metadata

Metadata

Assignees

Labels

Area: DocumentationImprovements or additions to documentationCategory: EnhancementNew feature or requestCategory: QuestionNot an issue but a question. May lead to enhancing docs

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions