Java RestHighLevelClient put mapping manually

Hello,

is there any way to put mapping with RestHighLevelClient?

I know that it's possible with TransportClient via this Doc page:
https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/java-admin-indices.html

But as for RestHighLevelClient I haven't found any information.

Best regards

Добрый день!

Подскажите, пожалуйста, есть ли возможность задать маппинг через RestHighLevelClient?
ну или хотя бы через low level client.

с уважением,

In one of the next versions 6.x, it looks like it will be possible to use the CreateIndex API call which will allow to set a mapping at index creation time:

https://www.elastic.co/guide/en/elasticsearch/client/java-rest/6.x/java-rest-high-create-index.html

Yeah. And here is how I'm doing it in the mean time:

2 Likes

I'm sorry, I forgot to mention that the version I'm using is 6.1, so it's better to get to 6.x since it has more features?

6.x is not released yet :slight_smile: that was just a link to documentation of the next future release.

Yes, 6.1 is the current and it doesn't have CreateIndex API :frowning:

By the way, for some reason gradle dependency is not working i.e. after ptting the following dependency no packages are being added to the project:

compile 'org.elasticsearch.client:elasticsearch-rest-high-level-client:6.2.0'

Normal since 6.2 is not released yet

You can inspire yourself from the code @dadoonet provided earlier, that should do the trick

Thank you, I'll look through it.

You are doing a workaround by getting lowlevelclient and performing basic http requests to put mapping, am I correct?

Yeah, apparently this is only way to do.

So, to sum up, there's no way in current stable version(6.1) to put mapping via High Level Client only, right?

Correct. As far as I know.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.