New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Index Warmup API #1913

Closed
kimchy opened this Issue May 6, 2012 · 4 comments

Comments

Projects
None yet
4 participants
@kimchy
Member

kimchy commented May 6, 2012

Index warming allows to run registered search requests to warm up the index before it is available for search. With the near real time aspect of search, cold data (segments) will be warmed up before they become available for search.

Warmup searches typically include requests that require heavy loading of data, such as faceting or sorting on specific fields.

The warmup APIs allows to register warmup (search) under specific names, remove them, and get them.

Index warmup can be disabled by setting index.warmer.enabled to false. It is supported as a realtime setting using update settings API. This can be handy when doing initial bulk indexing, disabling pre registered warmers to make indexing faster and less expensive and then enable it.

Put Warmer

Allows to put a warmup search request on a specific index (or indices), with the body composing of a regular search request. Types can be provided as part of the URI if the search request is designed to be run only against the specific types.

Here is an example that registers a warmup called warmer_1 against index test (can be alias or several indices), for a search request that runs against all types:

curl -XPUT localhost:9200/test/_warmer/warmer_1 -d '{
    "query" : {
        "match_all" : {}
    },
    "facets" : {
        "facet_1" : {
            "terms" : {
                "field" : "field"
            }
        } 
    }
}'

And an example that registers a warmup against specific types:

curl -XPUT localhost:9200/test/type1/_warmer/warmer_1 -d '{
    "query" : {
        "match_all" : {}
    },
    "facets" : {
        "facet_1" : {
            "terms" : {
                "field" : "field"
            }
        } 
    }
}'

Delete Warmer

Removing a warmer can be done against an index (or alias / indices) based on its name. The provided name can be a simple wildcard expression or omitted to remove all warmers. Some samples:

# delete warmer named warmer_1 on test index
curl -XDELETE localhost:9200/test/_warmer/warmer_1 

# delete all warmers that start with warm on test index
curl -XDELETE localhost:9200/test/_warmer/warm* 

# delete all warmers for test index
curl -XDELETE localhost:9200/test/_warmer/

GETting Warmer

Getting a warmer for specific index (or alias, or several indices) based on its name. The provided name can be a simple wildcard expression or omitted to get all warmers. Some examples:

# get warmer named warmer_1 on test index
curl -XGET localhost:9200/test/_warmer/warmer_1 

# get all warmers that start with warm on test index
curl -XGET localhost:9200/test/_warmer/warm* 

# get all warmers for test index
curl -XGET localhost:9200/test/_warmer/
@ppearcy

This comment has been minimized.

Show comment
Hide comment
@ppearcy

ppearcy May 7, 2012

Contributor

NICE ONE!!! Thanks!

Contributor

ppearcy commented May 7, 2012

NICE ONE!!! Thanks!

@kimchy

This comment has been minimized.

Show comment
Hide comment
@kimchy

kimchy May 7, 2012

Member

Note also #1916 and #1917 for the ability to register them on index creation, and in an index template.

Member

kimchy commented May 7, 2012

Note also #1916 and #1917 for the ability to register them on index creation, and in an index template.

@medcl

This comment has been minimized.

Show comment
Hide comment
@medcl

medcl Aug 5, 2012

Member

awesome!

Member

medcl commented Aug 5, 2012

awesome!

@tlrx

This comment has been minimized.

Show comment
Hide comment
@tlrx

tlrx Aug 6, 2012

Member

Looks great, thanks!

Member

tlrx commented Aug 6, 2012

Looks great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment