What if your search could run quietly in the background while you keep working?
Why Async search for expensive queries in Elasticsearch? - Purpose & Use Cases
Imagine you have a huge library of books and you want to find all books about a rare topic. You ask your friend to look through every shelf, but it takes a very long time. Meanwhile, you have to wait and can't do anything else.
Doing this search manually means you wait a long time for the answer. If the search is very slow, your app or website might freeze or become unresponsive. Also, if the search fails, you lose all progress and must start over.
Async search lets you start the search and then check back later for the results. This way, your app stays fast and responsive. You can do other things while waiting, and even handle very big searches without freezing.
POST /_search
{
"query": { "match": { "text": "rare topic" } }
}POST /_async_search
{
"query": { "match": { "text": "rare topic" } }
}Async search makes it easy to handle slow, heavy searches without blocking your users or systems.
A news website uses async search to find all articles about a breaking event across millions of records, letting readers keep browsing while the search runs.
Manual searches can block and slow down apps.
Async search runs queries in the background.
This keeps apps responsive and handles big data smoothly.