# Rust - How to use PIT?

**URL:** <https://discuss.elastic.co/t/rust-how-to-use-pit/341809>\
**Category:** Elasticsearch\
**Created:** [August 28, 2023, 1:35pm UTC](https://discuss.elastic.co/t/rust-how-to-use-pit/341809 "2023-08-28T13:35:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Frederick\_Sauvage](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/frederick_sauvage/32/125014_2.png) [@Frederick\_Sauvage](https://discuss.elastic.co/u/Frederick_Sauvage)\
**Post date:** [August 28, 2023, 1:35pm UTC](https://discuss.elastic.co/t/rust-how-to-use-pit/341809/1 "2023-08-28T13:35:28Z")

</div>

Hi,

I'm trying to add PIT in but I don't find how to do.

My code is similar as :

```auto
let client = Elasticsearch::default();
let s = client.search(SearchParts::None).size(1000).timeout("120s");
let search = Search::new().query(my_bool_query);
let response = s.body(json!(search)).allow_no_indices(true).send().await?;

```

What I understand :

- if I want to use a scroll, I can write let s = client.search(SearchParts::None).scroll("100s").size(1000).timeout("120s"); (and close it later)
- if I want to open or close a point in time, I can open and close one

I don't understand how to add the pid id in the body.

---

<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:** [September 25, 2023, 1:36pm UTC](https://discuss.elastic.co/t/rust-how-to-use-pit/341809/2 "2023-09-25T13:36:24Z")

</div>

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