Control query cache

Hi,

I'm using Elasticsearch to index logs of hundreds of thousands of IOT devices.
I have thousands of customers and each one of them is permitted to query logs of some of the devices.
To enforce the permissions I used Parent-Child reference by the following model:
Child - log
Parent - list of device's permitted customers.
My problem, Is that queries using "has_parent" filter are taking a lot of time when not in the query cache.

Is it possible to config elasticsearch so it keep this query always in the cache?
Is it possible to control which queries get into cache and which not?
As I understand, queries are cached only if they were executed 5 times out of the 256 last queries. Is there a flag that cache the query no matter what?
Is it possible to make the Query Cache update eagerly upon refresh?

Assuming the answer to all of the above is "No",
Is it possible to implement custom cache and integrate it into elasticsearch natively (without the need to fork the project)

Also,
If you have a better solution for my permissions management I'd be glad to hear :slight_smile:

Thanks,
Nimrod

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