Is there caching for knn search so it returns records if same querry is fired

i fired 100 querries to elastic knn search with 0.4 million records and calculated average time per querry which was about 200 ms for first iteration. i re fired same querries just after 5 sec and response time per query became 25 ms. How it reduced. is there inbuilt caching in elastic vector ?

@Himanshu_Pal

Unless specifically asked in the request, the query results themselves are not cached. However, the following caching methods are used:

  • Any filters you have applied, those will be cached
  • The knn segment data files are cached in memory so that they won't have to be read off disk. Note, queries are still processed, but reading the knn files is much faster as they are already loaded into cached memory.

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