# Creation of PIT using Rest High Level Client in Java SDK

**URL:** <https://discuss.elastic.co/t/creation-of-pit-using-rest-high-level-client-in-java-sdk/270039>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [April 13, 2021, 4:27pm UTC](https://discuss.elastic.co/t/creation-of-pit-using-rest-high-level-client-in-java-sdk/270039 "2021-04-13T16:27:00Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![RapTvin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/raptvin/32/86995_2.png) [@RapTvin](https://discuss.elastic.co/u/RapTvin)\
**Post date:** [April 13, 2021, 4:27pm UTC](https://discuss.elastic.co/t/creation-of-pit-using-rest-high-level-client-in-java-sdk/270039/1 "2021-04-13T16:27:00Z")

</div>

I was going through the Rest High-Level Client and wasn't able to get a method to create a Point In Time via the java SDK of the client.

Is there a way to do it programmatically?

I went through a earlier post which addresses the same but it didn't have a reply please do revert back on this

---

<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:** [April 13, 2021, 5:28pm UTC](https://discuss.elastic.co/t/creation-of-pit-using-rest-high-level-client-in-java-sdk/270039/2 "2021-04-13T17:28:07Z")

</div>

Welcome!

That's a very good question. I'm wondering if it has been added to the rest client as I can't see it here:

> <https://github.com/elastic/elasticsearch/blob/7.12/client/rest-high-level/src/main/java/org/elasticsearch/client/RestHighLevelClient.java>

@swallez Do you know?

---

<div class="post-metadata">

**Author:** ![RapTvin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/raptvin/32/86995_2.png) [@RapTvin](https://discuss.elastic.co/u/RapTvin)\
**Post date:** [April 13, 2021, 7:34pm UTC](https://discuss.elastic.co/t/creation-of-pit-using-rest-high-level-client-in-java-sdk/270039/3 "2021-04-13T19:34:44Z")

</div>

I made use of the Low Level Client for now as I think this feature is not there in the High Level Client yet

---

<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:** [April 13, 2021, 8:22pm UTC](https://discuss.elastic.co/t/creation-of-pit-using-rest-high-level-client-in-java-sdk/270039/4 "2021-04-13T20:22:47Z")

</div>

It looks like the SearchSourceBuilder accepts a PointInTimeBuilder. Could you check that?

---

<div class="post-metadata">

**Author:** ![RapTvin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/raptvin/32/86995_2.png) [@RapTvin](https://discuss.elastic.co/u/RapTvin)\
**Post date:** [April 13, 2021, 8:34pm UTC](https://discuss.elastic.co/t/creation-of-pit-using-rest-high-level-client-in-java-sdk/270039/5 "2021-04-13T20:34:10Z")

</div>

I was unable to find any such method that accepts a `PointInTimeBuilder` and the class `PointIntTimeBuilder` isn't present

---

<div class="post-metadata">

**Author:** ![jakelandis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jakelandis/32/36163_2.png) [@jakelandis](https://discuss.elastic.co/u/jakelandis)\
**Post date:** [April 13, 2021, 8:52pm UTC](https://discuss.elastic.co/t/creation-of-pit-using-rest-high-level-client-in-java-sdk/270039/6 "2021-04-13T20:52:10Z")

</div>

See [elasticsearch/SearchSourceBuilder.java at v7.12.0 · elastic/elasticsearch · GitHub](https://github.com/elastic/elasticsearch/blob/v7.12.0/server/src/main/java/org/elasticsearch/search/builder/SearchSourceBuilder.java#L1021)

in conjunction with [Search API | Java REST Client [7.12] | Elastic](https://www.elastic.co/guide/en/elasticsearch/client/java-rest/7.12/java-rest-high-search.html)

I believe you need 7.10.0 or greater.

---

<div class="post-metadata">

**Author:** ![RapTvin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/raptvin/32/86995_2.png) [@RapTvin](https://discuss.elastic.co/u/RapTvin)\
**Post date:** [April 13, 2021, 10:00pm UTC](https://discuss.elastic.co/t/creation-of-pit-using-rest-high-level-client-in-java-sdk/270039/7 "2021-04-13T22:00:22Z")

</div>

Yes, it was an issue with the package versioning but reached another barrier while paginating it with Java API.

The issue is clearly defined in this GitHub issue but there are no solutions yet can you help with that @jakelandis

**Link:** [RestHighLevelClient: indicesOptions cannot be used with point in time, but is not nullable in SearchRequest · Issue #69974 · elastic/elasticsearch · GitHub](https://github.com/elastic/elasticsearch/issues/69974)

---

<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:** [May 11, 2021, 10:00pm UTC](https://discuss.elastic.co/t/creation-of-pit-using-rest-high-level-client-in-java-sdk/270039/8 "2021-05-11T22:00:40Z")

</div>

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