Queries cached


(Sisu Alexandru) #1

Hi all,

I'm curious about the cache mechanism used in es for queries.
The query goes like that:

{
"query": {
"bool": {
"should": {
"terms": {
"body": [
"photo"
]
}
}
}
}
}

A simple query. The first execution takes 45 ms. The second one 3 ms.

How does this query gets cached?
Which are the classes in elastic-search that handle this?
Which are the options for configuring the es query caches.

I saw that caches and facet caches exist. But I couldn't find out anything
about the queries being cached.

Tnx in advance,

Alex


(Shay Banon) #2

Queries are not being cached. The reason you see it executing it faster is because of two aspects, the file system cache, and the recent term loaded mini cache in Lucene (not configurable).

On Monday, January 30, 2012 at 4:31 PM, Sisu Alexandru wrote:

Hi all,

I'm curious about the cache mechanism used in es for queries.
The query goes like that:

{
"query": {
"bool": {
"should": {
"terms": {
"body": [
"photo"
]
}
}
}
}
}

A simple query. The first execution takes 45 ms. The second one 3 ms.

How does this query gets cached?
Which are the classes in elastic-search that handle this?
Which are the options for configuring the es query caches.

I saw that caches and facet caches exist. But I couldn't find out anything about the queries being cached.

Tnx in advance,

Alex


(system) #3