# Elastic Search High level Client for OSS 7.4

**URL:** <https://discuss.elastic.co/t/elastic-search-high-level-client-for-oss-7-4/298369>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [February 28, 2022, 4:56am UTC](https://discuss.elastic.co/t/elastic-search-high-level-client-for-oss-7-4/298369 "2022-02-28T04:56:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mangeshs](https://avatars.discourse-cdn.com/v4/letter/m/e36b37/32.png) [@mangeshs](https://discuss.elastic.co/u/mangeshs)\
**Post date:** [February 28, 2022, 4:56am UTC](https://discuss.elastic.co/t/elastic-search-high-level-client-for-oss-7-4/298369/1 "2022-02-28T04:56:20Z")

</div>

I am using Elasticsearch 7.4.0 OSS version server and want to connect via java rest api service.  
So I used EL rest high level client

```auto
<dependency>
    <groupId>org.elasticsearch.client</groupId>
    <artifactId>elasticsearch-rest-high-level-client</artifactId>
    <version>7.4.2</version>
</dependency>

```

but by creating client and using some request to create index I am getting an error

````auto
Forwarding to error page from request [/archive/index/create] due to exception [Invalid or missing build flavor [oss]]
ElasticsearchException[Invalid or missing build flavor [oss]]
	at org.elasticsearch.client.RestHighLevelClient.performClientRequest(RestHighLevelClient.java:2084)
	at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1732)
	at org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:1717)```

````

and my service java code is  
public class ElasticClientService {

```
public static RestHighLevelClient getHighLevelClient() {
	return new RestHighLevelClient(RestClient.builder(new HttpHost("localhost", 9201, "http")));
}

public static boolean createIndex() {
	CreateIndexResponse createIndexResponse = null;
	CreateIndexRequest request = new CreateIndexRequest("archive01");
	request.settings(Settings.builder().put("index.number_of_shards", 3).put("index.number_of_replicas", 2));
	request.mapping("{\n" + " \"properties\": {\n" + " \"message\": {\n" + " \"type\": \"text\"\n"
			+ " }\n" + " }\n" + "}", XContentType.JSON);
	try {
		createIndexResponse = getHighLevelClient().indices().create(request, RequestOptions.DEFAULT);

	} catch (IOException e) {
		e.printStackTrace();
		return false;
	}
	boolean acknowledged = createIndexResponse.isAcknowledged();
	boolean shardsAcknowledged = createIndexResponse.isShardsAcknowledged();
	if (acknowledged == true && shardsAcknowledged == true) {
		return true;
	}
	return false;
}

```

}

```auto
what should I do? Is it not allowed to use RHLC for OSS versions?
```

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 28, 2022, 7:23am UTC](https://discuss.elastic.co/t/elastic-search-high-level-client-for-oss-7-4/298369/2 "2022-02-28T07:23:22Z")

</div>

Are you sure you are using the version 7.4 of the client? I think you have a more recent one in your classpath.

---

<div class="post-metadata">

**Author:** ![mangeshs](https://avatars.discourse-cdn.com/v4/letter/m/e36b37/32.png) [@mangeshs](https://discuss.elastic.co/u/mangeshs)\
**Post date:** [February 28, 2022, 8:14am UTC](https://discuss.elastic.co/t/elastic-search-high-level-client-for-oss-7-4/298369/3 "2022-02-28T08:14:48Z")

</div>

It was issue of jar. I solved. Thanks.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 28, 2022, 8:15am UTC](https://discuss.elastic.co/t/elastic-search-high-level-client-for-oss-7-4/298369/4 "2022-03-28T08:15:20Z")

</div>

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