-
Notifications
You must be signed in to change notification settings - Fork 24.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
3 changed files
with
95 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,103 @@ | ||
[[indices-refresh]] | ||
=== Refresh | ||
=== Refresh API | ||
++++ | ||
<titleabbrev>Refresh</titleabbrev> | ||
++++ | ||
|
||
The refresh API allows to explicitly refresh one or more index, making | ||
all operations performed since the last refresh available for search. | ||
The (near) real-time capabilities depend on the index engine used. For | ||
example, the internal one requires refresh to be called, but by default a | ||
refresh is scheduled periodically. | ||
Refreshes one or more indices. | ||
|
||
[source,js] | ||
-------------------------------------------------- | ||
[source,console] | ||
---- | ||
POST /twitter/_refresh | ||
-------------------------------------------------- | ||
// CONSOLE | ||
---- | ||
// TEST[setup:twitter] | ||
|
||
[float] | ||
==== Multi Index | ||
|
||
The refresh API can be applied to more than one index with a single | ||
call, or even on `_all` the indices. | ||
[[refresh-api-request]] | ||
==== {api-request-title} | ||
|
||
[source,js] | ||
-------------------------------------------------- | ||
`POST <index>/_refresh` | ||
|
||
`GET <index>/_refresh` | ||
|
||
`POST /_refresh` | ||
|
||
`GET /_refresh` | ||
|
||
|
||
[[refresh-api-desc]] | ||
==== {api-description-title} | ||
|
||
Use the refresh API to explicitly refresh one or more indices. | ||
A _refresh_ makes all operations performed on an index | ||
since the last refresh | ||
available for search. | ||
|
||
// tag::refresh-interval-default[] | ||
By default, Elasticsearch periodically refreshes indices every second, but only on | ||
indices that have received one search request or more in the last 30 seconds. | ||
// end::refresh-interval-default[] | ||
You can change this default interval | ||
using the <<index-refresh-interval-setting,`index.refresh_interval`>> setting. | ||
|
||
[IMPORTANT] | ||
==== | ||
Refreshes are a resource-intensive. | ||
To ensure good cluster performance, | ||
we recommend waiting for {es}'s periodic refresh | ||
rather than performing an explicit refresh | ||
when possible. | ||
If your application workflow | ||
indexes documents and then runs a search | ||
to retrieve the indexed document, | ||
we recommend using the <<docs-index_,index API>>'s | ||
`refresh=wait_for` query parameter option. | ||
This option ensures the indexing operation waits | ||
for a periodic refresh | ||
before running the search. | ||
==== | ||
|
||
[[refresh-api-path-params]] | ||
==== {api-path-parms-title} | ||
|
||
include::{docdir}/rest-api/common-parms.asciidoc[tag=index] | ||
+ | ||
To refresh all indices in the cluster, | ||
omit this parameter | ||
or use a value of `_all` or `*`. | ||
|
||
|
||
[[refresh-api-query-params]] | ||
==== {api-query-parms-title} | ||
|
||
include::{docdir}/rest-api/common-parms.asciidoc[tag=allow-no-indices] | ||
|
||
include::{docdir}/rest-api/common-parms.asciidoc[tag=expand-wildcards] | ||
+ | ||
Defaults to `open`. | ||
|
||
include::{docdir}/rest-api/common-parms.asciidoc[tag=index-ignore-unavailable] | ||
|
||
|
||
[[refresh-api-example]] | ||
==== {api-examples-title} | ||
|
||
|
||
[[refresh-api-multiple-ex]] | ||
===== Refresh several indices | ||
|
||
[source,console] | ||
---- | ||
POST /kimchy,elasticsearch/_refresh | ||
---- | ||
// TEST[s/^/PUT kimchy\nPUT elasticsearch\n/] | ||
|
||
|
||
[[refresh-api-all-ex]] | ||
===== Refresh all indices | ||
|
||
[source,console] | ||
---- | ||
POST /_refresh | ||
-------------------------------------------------- | ||
// CONSOLE | ||
// TEST[s/^/PUT kimchy\nPUT elasticsearch\n/] | ||
---- |