Warming up

Sometimes, there may be a need to prepare ElasticSearch to handle your queries. Maybe it's because you rely heavily on the field data cache and you want it to be loaded before your production queries arrive or maybe you want to warm up your operating system's I/O cache. Whatever the reason is, ElasticSearch allows us to define the warming queries for our types and indices.

Defining a new warming query

A warming query is nothing more than the usual query stored in a special index in ElasticSearch called _warmer. Let's assume we have the following query that we want to use for warming up:

{
  "query" : {
    "match_all" : {}
  },
  "facets" : {
    "warming_facet" : {
      "terms" : {
        "field" : "tags"
      }
    }
  }
}

In order to store the preceding query as a warming ...

Get ElasticSearch Server now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.