# Async Search - How to get list of IDs?

**URL:** <https://discuss.elastic.co/t/async-search-how-to-get-list-of-ids/353660>\
**Category:** Elasticsearch\
**Tags:** async-search\
**Created:** [February 20, 2024, 8:42am UTC](https://discuss.elastic.co/t/async-search-how-to-get-list-of-ids/353660 "2024-02-20T08:42:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![BBQigniter](https://avatars.discourse-cdn.com/v4/letter/b/3da27b/32.png) [@BBQigniter](https://discuss.elastic.co/u/BBQigniter)\
**Post date:** [February 20, 2024, 8:42am UTC](https://discuss.elastic.co/t/async-search-how-to-get-list-of-ids/353660/1 "2024-02-20T08:42:44Z")

</div>

Do I see that correctly that there is currently **NO** chance to retrieve an async-search ID if someone missed to save it?

---

<div class="post-metadata">

**Author:** ![carly.richmond](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carly.richmond/32/104935_2.png) [@carly.richmond](https://discuss.elastic.co/u/carly.richmond)\
**Post date:** [February 20, 2024, 11:08am UTC](https://discuss.elastic.co/t/async-search-how-to-get-list-of-ids/353660/2 "2024-02-20T11:08:30Z")

</div>

Hi @BBQigniter,

Welcome back! I'm aware there is away to get the [running tasks](https://www.elastic.co/guide/en/elasticsearch/reference/current/tasks.html). But I'm not sure there is a way to get the IDs of previously run async query.

I'm sure others will chime in if they know of a way.

---

<div class="post-metadata">

**Author:** ![BBQigniter](https://avatars.discourse-cdn.com/v4/letter/b/3da27b/32.png) [@BBQigniter](https://discuss.elastic.co/u/BBQigniter)\
**Post date:** [February 22, 2024, 2:10pm UTC](https://discuss.elastic.co/t/async-search-how-to-get-list-of-ids/353660/3 "2024-02-22T14:10:23Z")

</div>

I figured out that the async-search's ID that you receive, is a base64 encrypted key in format

```auto
# <index/field-name>!...
<.async-search/_id>!<.tasks/task.node>:<.tasks/task.id>

```

So for example you execute an async-search and get ID

`FmxmT2tfSGVmUzRpR3lIeGlIMjQ3OXchbVNQWEdxUVVRMzZEOGlCa3dsWEFxdzoxNDQ1NzU2NzE4`

decoded this will be

`lfOk_HefS4iGyHxiH2479w!mSPXGqQUQ36D8iBkwlXAqw:1445756718`

you can find a document in the `.asnyc-search`-index

```auto
GET .async-search/_search
{
  "query": {
    "bool": {
      "filter": [
        {
          "match": {
            "_id": "lfOk_HefS4iGyHxiH2479w"
          }
        }
      ]
    }
  }
}

```

With my theory I should be able to find a "completed" task with `task.id: 1445756718` in the `.tasks`-index.

```auto
GET .tasks/_search
{
  "query": {
    "bool": {
      "filter": [
        {
          "match": {
            "task.id": "1445756718"
          }
        }
      ]
    }
  }
}

```

But i get no results. I it looks like not all completed tasks are saved in the `.tasks`-index or is it even deprecated with Elasticsearch 8.12+? I had a look at a few chanelogs, but couldn't find anything mentioning `.tasks`.  
I observed the index stats now for quite a while, but it didn't change. I only see some task-descriptions that seem to be related to v7+ up to v8.8.1

---

<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 21, 2024, 2:11pm UTC](https://discuss.elastic.co/t/async-search-how-to-get-list-of-ids/353660/4 "2024-03-21T14:11:12Z")

</div>

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