1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
|
[[indices-warmers]]
== Warmers
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.
[float]
[[creation]]
=== Index Creation / Templates
Warmers can be registered when an index gets created, for example:
[source,js]
--------------------------------------------------
curl -XPUT localhost:9200/test -d '{
"warmers" : {
"warmer_1" : {
"types" : [],
"source" : {
"query" : {
...
},
"facets" : {
...
}
}
}
}
}'
--------------------------------------------------
Or, in an index template:
[source,js]
--------------------------------------------------
curl -XPUT localhost:9200/_template/template_1 -d '
{
"template" : "te*",
"warmers" : {
"warmer_1" : {
"types" : [],
"source" : {
"query" : {
...
},
"facets" : {
...
}
}
}
}
}'
--------------------------------------------------
[float]
[[warmer-adding]]
=== 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:
[source,js]
--------------------------------------------------
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:
[source,js]
--------------------------------------------------
curl -XPUT localhost:9200/test/type1/_warmer/warmer_1 -d '{
"query" : {
"match_all" : {}
},
"facets" : {
"facet_1" : {
"terms" : {
"field" : "field"
}
}
}
}'
--------------------------------------------------
All options:
[source,js]
--------------------------------------------------
PUT _warmer/{warmer_name}
PUT /{index}/_warmer/{warmer_name}
PUT /{index}/{type}/_warmer/{warmer_name}
--------------------------------------------------
where
[horizontal]
`{index}`:: `* | _all | glob pattern | name1, name2, …`
`{type}`:: `* | _all | glob pattern | name1, name2, …`
Instead of `_warmer` you can also use the plural `_warmers`.
[float]
[[removing]]
=== Delete Warmers
Warmers can be deleted using the following endpoint:
[source,js]
--------------------------------------------------
[DELETE] /{index}/_warmer/{name}
--------------------------------------------------
where
[horizontal]
`{index}`:: `* | _all | glob pattern | name1, name2, …`
`{name}`:: `* | _all | glob pattern | name1, name2, …`
Instead of `_warmer` you can also use the plural `_warmers`.
[float]
[[warmer-retrieving]]
=== 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:
[source,js]
--------------------------------------------------
# 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/
--------------------------------------------------
|