Is there any external implementation to cache a query in elastic?

I am trying to cache a query. so that next time when I do the same query, results from the cache are retrieved.

Filters are cached, not queries. But elasticsearch uses a lot the file system cache.

You should not normally worry about that.

Thanks for your quick response. I have a couple of questions.

  1. So filters are cached. for example when you have below query:

GET persons/person/_search
{
"query":{
"bool":{
"must":[
{
"match":{
"firstName":"Keith"
}
},
{
"match":{
"gender":"M"
}
}
],
"filter":[
{
"range":{
"dob":{
"gte":"1920"
}
}
}
]
}
}
}

How can we cache the filtered context in above query? If exists how should we enable "_cache":"true"

  1. So you mean, the hot indexes are always fast in retrieval because elastic uses file system cache? and we need not implement any caching mechanism explicitly. Elastic can handle caching by default?

Thanks and Regards,
Surya

How can we cache the filtered context in above query?

It's automatically done.

What is the problem you want to solve here?

I wanted to use Elastic Search to store huge amounts of data. My API will be calling Elasticsearch frequently using GET queries. I am now just researching on elastic search caching behavior to analyze the performance of data retrieval.

Just try with defaults. If any problem just ask here and we will help.

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