Async Search - How to get list of IDs?

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

Hi @BBQigniter,

Welcome back! I'm aware there is away to get the running tasks. 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.

1 Like

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

# <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

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.

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

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