# Is it possible to call REST API call to elastic using JAVA

**URL:** <https://discuss.elastic.co/t/is-it-possible-to-call-rest-api-call-to-elastic-using-java/297278>\
**Category:** Elasticsearch\
**Created:** [February 15, 2022, 5:32pm UTC](https://discuss.elastic.co/t/is-it-possible-to-call-rest-api-call-to-elastic-using-java/297278 "2022-02-15T17:32:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ranju](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ranju/32/84299_2.png) [@ranju](https://discuss.elastic.co/u/ranju)\
**Post date:** [February 15, 2022, 5:32pm UTC](https://discuss.elastic.co/t/is-it-possible-to-call-rest-api-call-to-elastic-using-java/297278/1 "2022-02-15T17:32:29Z")

</div>

Need to call this type of query via REST API

```auto
	String query = "{"bool": {"must": [{"match_phrase": {"countryName": "INDIA"}}], "must_not": [], "should": []}}";
	

```

---

<div class="post-metadata">

**Author:** ![linkerc](https://avatars.discourse-cdn.com/v4/letter/l/13edae/32.png) [@linkerc](https://discuss.elastic.co/u/linkerc)\
**Post date:** [February 15, 2022, 10:22pm UTC](https://discuss.elastic.co/t/is-it-possible-to-call-rest-api-call-to-elastic-using-java/297278/2 "2022-02-15T22:22:45Z")

</div>

> **[Search API | Java REST Client \[7.3\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/client/java-rest/7.3/java-rest-high-search.html)**

---

<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 15, 2022, 10:22pm UTC](https://discuss.elastic.co/t/is-it-possible-to-call-rest-api-call-to-elastic-using-java/297278/3 "2022-03-15T22:22:50Z")

</div>

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