Skip to content

Commit 538cdcd

Browse files
committed
Merge branch 'master' into replicated-closed-indices
2 parents b756f6c + 12006ea commit 538cdcd

File tree

141 files changed

+2315
-1289
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+2315
-1289
lines changed

buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ public void setDistribution(Distribution distribution) {
129129
public void freeze() {
130130
requireNonNull(distribution, "null distribution passed when configuring test cluster `" + this + "`");
131131
requireNonNull(version, "null version passed when configuring test cluster `" + this + "`");
132+
requireNonNull(javaHome, "null javaHome passed when configuring test cluster `" + this + "`");
132133
logger.info("Locking configuration of `{}`", this);
133134
configurationFrozen.set(true);
134135
}
@@ -204,16 +205,7 @@ private void startElasticsearchProcess(Path distroArtifact) {
204205
Map<String, String> environment = processBuilder.environment();
205206
// Don't inherit anything from the environment for as that would lack reproductability
206207
environment.clear();
207-
if (javaHome != null) {
208-
environment.put("JAVA_HOME", getJavaHome().getAbsolutePath());
209-
} else if (System.getenv().get("JAVA_HOME") != null) {
210-
logger.warn("{}: No java home configured will use it from environment: {}",
211-
this, System.getenv().get("JAVA_HOME")
212-
);
213-
environment.put("JAVA_HOME", System.getenv().get("JAVA_HOME"));
214-
} else {
215-
logger.warn("{}: No javaHome configured, will rely on default java detection", this);
216-
}
208+
environment.put("JAVA_HOME", getJavaHome().getAbsolutePath());
217209
environment.put("ES_PATH_CONF", configFile.getParent().toAbsolutePath().toString());
218210
environment.put("ES_JAVA_OPTIONS", "-Xms512m -Xmx512m");
219211
// don't buffer all in memory, make sure we don't block on the default pipes

client/rest-high-level/src/test/java/org/elasticsearch/client/IndicesClientIT.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1261,7 +1261,8 @@ public void testGetAlias() throws IOException {
12611261
GetAliasesResponse getAliasesResponse = execute(getAliasesRequest, highLevelClient().indices()::getAlias,
12621262
highLevelClient().indices()::getAliasAsync);
12631263

1264-
assertThat(getAliasesResponse.getAliases().size(), equalTo(3));
1264+
assertThat("Unexpected number of aliases, got: " + getAliasesResponse.getAliases().toString(),
1265+
getAliasesResponse.getAliases().size(), equalTo(3));
12651266
assertThat(getAliasesResponse.getAliases().get("index1").size(), equalTo(1));
12661267
AliasMetaData aliasMetaData1 = getAliasesResponse.getAliases().get("index1").iterator().next();
12671268
assertThat(aliasMetaData1, notNullValue());

distribution/docker/src/docker/Dockerfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ RUN curl --retry 8 -s ${jdkUrl} | tar -C /opt -zxf -
2323
# REF: https://github.com/elastic/elasticsearch-docker/issues/171
2424
RUN ln -sf /etc/pki/ca-trust/extracted/java/cacerts /opt/jdk-${jdkVersion}/lib/security/cacerts
2525

26-
RUN yum install -y unzip which
27-
2826
RUN groupadd -g 1000 elasticsearch && \
2927
adduser -u 1000 -g 1000 -d /usr/share/elasticsearch elasticsearch
3028

@@ -51,7 +49,7 @@ ENV JAVA_HOME /opt/jdk-${jdkVersion}
5149
COPY --from=builder /opt/jdk-${jdkVersion} /opt/jdk-${jdkVersion}
5250

5351
RUN yum update -y && \
54-
yum install -y nc unzip wget which && \
52+
yum install -y nc && \
5553
yum clean all
5654

5755
RUN groupadd -g 1000 elasticsearch && \

docs/plugins/repository-s3.asciidoc

Lines changed: 133 additions & 85 deletions
Large diffs are not rendered by default.

docs/reference/analysis/tokenfilters/synonym-graph-tokenfilter.asciidoc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
[[analysis-synonym-graph-tokenfilter]]
22
=== Synonym Graph Token Filter
33

4-
beta[]
5-
64
The `synonym_graph` token filter allows to easily handle synonyms,
75
including multi-word synonyms correctly during the analysis process.
86

@@ -187,3 +185,8 @@ multiple versions of a token may choose which version of the token to emit when
187185
parsing synonyms, e.g. `asciifolding` will only produce the folded version of the
188186
token. Others, e.g. `multiplexer`, `word_delimiter_graph` or `ngram` will throw an
189187
error.
188+
189+
WARNING:The synonym rules should not contain words that are removed by
190+
a filter that appears after in the chain (a `stop` filter for instance).
191+
Removing a term from a synonym rule breaks the matching at query time.
192+

docs/reference/cat/shards.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ twitter 0 p STARTED 3014 31.1mb 192.168.56.10 H5dfFeA
5656
[[relocation]]
5757
=== Relocation
5858

59-
Let's say you've checked your health and you see a relocating
59+
Let's say you've checked your health and you see relocating
6060
shards. Where are they from and where are they going?
6161

6262
[source,js]

docs/reference/docs/bulk.asciidoc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ optional_source\n
3636
--------------------------------------------------
3737
// NOTCONSOLE
3838

39-
*NOTE*: the final line of data must end with a newline character `\n`. Each newline character
39+
*NOTE*: The final line of data must end with a newline character `\n`. Each newline character
4040
may be preceded by a carriage return `\r`. When sending requests to this endpoint the
4141
`Content-Type` header should be set to `application/x-ndjson`.
4242

43-
The possible actions are `index`, `create`, `delete` and `update`.
43+
The possible actions are `index`, `create`, `delete`, and `update`.
4444
`index` and `create` expect a source on the next
4545
line, and have the same semantics as the `op_type` parameter to the
4646
standard index API (i.e. create will fail if a document with the same
@@ -214,7 +214,7 @@ documents. See <<optimistic-concurrency-control>> for more details.
214214
Each bulk item can include the version value using the
215215
`version` field. It automatically follows the behavior of the
216216
index / delete operation based on the `_version` mapping. It also
217-
support the `version_type` (see <<index-versioning, versioning>>)
217+
support the `version_type` (see <<index-versioning, versioning>>).
218218

219219
[float]
220220
[[bulk-routing]]
@@ -245,20 +245,20 @@ NOTE: Only the shards that receive the bulk request will be affected by
245245
`refresh`. Imagine a `_bulk?refresh=wait_for` request with three
246246
documents in it that happen to be routed to different shards in an index
247247
with five shards. The request will only wait for those three shards to
248-
refresh. The other two shards of that make up the index do not
248+
refresh. The other two shards that make up the index do not
249249
participate in the `_bulk` request at all.
250250

251251
[float]
252252
[[bulk-update]]
253253
=== Update
254254

255-
When using `update` action `retry_on_conflict` can be used as field in
255+
When using the `update` action, `retry_on_conflict` can be used as a field in
256256
the action itself (not in the extra payload line), to specify how many
257257
times an update should be retried in the case of a version conflict.
258258

259-
The `update` action payload, supports the following options: `doc`
259+
The `update` action payload supports the following options: `doc`
260260
(partial document), `upsert`, `doc_as_upsert`, `script`, `params` (for
261-
script), `lang` (for script) and `_source`. See update documentation for details on
261+
script), `lang` (for script), and `_source`. See update documentation for details on
262262
the options. Example with update actions:
263263

264264
[source,js]
@@ -282,4 +282,4 @@ POST _bulk
282282
[[bulk-security]]
283283
=== Security
284284

285-
See <<url-access-control>>
285+
See <<url-access-control>>.

docs/reference/docs/delete-by-query.asciidoc

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
== Delete By Query API
33

44
The simplest usage of `_delete_by_query` just performs a deletion on every
5-
document that match a query. Here is the API:
5+
document that matches a query. Here is the API:
66

77
[source,js]
88
--------------------------------------------------
@@ -20,7 +20,7 @@ POST twitter/_delete_by_query
2020

2121
<1> The query must be passed as a value to the `query` key, in the same
2222
way as the <<search-search,Search API>>. You can also use the `q`
23-
parameter in the same way as the search api.
23+
parameter in the same way as the search API.
2424

2525
That will return something like this:
2626

@@ -68,7 +68,7 @@ these documents. In case a search or bulk request got rejected, `_delete_by_quer
6868
failures that are returned by the failing bulk request are returned in the `failures`
6969
element; therefore it's possible for there to be quite a few failed entities.
7070

71-
If you'd like to count version conflicts rather than cause them to abort then
71+
If you'd like to count version conflicts rather than cause them to abort, then
7272
set `conflicts=proceed` on the url or `"conflicts": "proceed"` in the request body.
7373

7474
Back to the API format, this will delete tweets from the `twitter` index:
@@ -140,14 +140,14 @@ POST twitter/_delete_by_query?scroll_size=5000
140140
[float]
141141
=== URL Parameters
142142

143-
In addition to the standard parameters like `pretty`, the Delete By Query API
144-
also supports `refresh`, `wait_for_completion`, `wait_for_active_shards`, `timeout`
143+
In addition to the standard parameters like `pretty`, the delete by query API
144+
also supports `refresh`, `wait_for_completion`, `wait_for_active_shards`, `timeout`,
145145
and `scroll`.
146146

147147
Sending the `refresh` will refresh all shards involved in the delete by query
148-
once the request completes. This is different than the Delete API's `refresh`
148+
once the request completes. This is different than the delete API's `refresh`
149149
parameter which causes just the shard that received the delete request
150-
to be refreshed. Also unlike the Delete API it does not support `wait_for`.
150+
to be refreshed. Also unlike the delete API it does not support `wait_for`.
151151

152152
If the request contains `wait_for_completion=false` then Elasticsearch will
153153
perform some preflight checks, launch the request, and then return a `task`
@@ -163,10 +163,10 @@ for details. `timeout` controls how long each write request waits for unavailabl
163163
shards to become available. Both work exactly how they work in the
164164
<<docs-bulk,Bulk API>>. As `_delete_by_query` uses scroll search, you can also specify
165165
the `scroll` parameter to control how long it keeps the "search context" alive,
166-
eg `?scroll=10m`, by default it's 5 minutes.
166+
e.g. `?scroll=10m`. By default it's 5 minutes.
167167

168168
`requests_per_second` can be set to any positive decimal number (`1.4`, `6`,
169-
`1000`, etc) and throttles rate at which `_delete_by_query` issues batches of
169+
`1000`, etc.) and throttles the rate at which delete by query issues batches of
170170
delete operations by padding each batch with a wait time. The throttling can be
171171
disabled by setting `requests_per_second` to `-1`.
172172

@@ -182,7 +182,7 @@ target_time = 1000 / 500 per second = 2 seconds
182182
wait_time = target_time - write_time = 2 seconds - .5 seconds = 1.5 seconds
183183
--------------------------------------------------
184184

185-
Since the batch is issued as a single `_bulk` request large batch sizes will
185+
Since the batch is issued as a single `_bulk` request, large batch sizes will
186186
cause Elasticsearch to create many requests and then wait for a while before
187187
starting the next set. This is "bursty" instead of "smooth". The default is `-1`.
188188

@@ -259,13 +259,13 @@ The number of version conflicts that the delete by query hit.
259259
`noops`::
260260

261261
This field is always equal to zero for delete by query. It only exists
262-
so that delete by query, update by query and reindex APIs return responses
262+
so that delete by query, update by query, and reindex APIs return responses
263263
with the same structure.
264264

265265
`retries`::
266266

267267
The number of retries attempted by delete by query. `bulk` is the number
268-
of bulk actions retried and `search` is the number of search actions retried.
268+
of bulk actions retried, and `search` is the number of search actions retried.
269269

270270
`throttled_millis`::
271271

@@ -286,7 +286,7 @@ executed again in order to conform to `requests_per_second`.
286286

287287
Array of failures if there were any unrecoverable errors during the process. If
288288
this is non-empty then the request aborted because of those failures.
289-
Delete-by-query is implemented using batches and any failure causes the entire
289+
Delete by query is implemented using batches, and any failure causes the entire
290290
process to abort but all failures in the current batch are collected into the
291291
array. You can use the `conflicts` option to prevent reindex from aborting on
292292
version conflicts.
@@ -296,7 +296,7 @@ version conflicts.
296296
[[docs-delete-by-query-task-api]]
297297
=== Works with the Task API
298298

299-
You can fetch the status of any running delete-by-query requests with the
299+
You can fetch the status of any running delete by query requests with the
300300
<<tasks,Task API>>:
301301

302302
[source,js]
@@ -306,7 +306,7 @@ GET _tasks?detailed=true&actions=*/delete/byquery
306306
// CONSOLE
307307
// TEST[skip:No tasks to retrieve]
308308

309-
The responses looks like:
309+
The response looks like:
310310

311311
[source,js]
312312
--------------------------------------------------
@@ -346,7 +346,7 @@ The responses looks like:
346346
}
347347
--------------------------------------------------
348348
// TESTRESPONSE
349-
<1> this object contains the actual status. It is just like the response json
349+
<1> This object contains the actual status. It is just like the response JSON
350350
with the important addition of the `total` field. `total` is the total number
351351
of operations that the reindex expects to perform. You can estimate the
352352
progress by adding the `updated`, `created`, and `deleted` fields. The request
@@ -373,7 +373,7 @@ you to delete that document.
373373
[[docs-delete-by-query-cancel-task-api]]
374374
=== Works with the Cancel Task API
375375

376-
Any Delete By Query can be canceled using the <<tasks,task cancel API>>:
376+
Any delete by query can be canceled using the <<tasks,task cancel API>>:
377377

378378
[source,js]
379379
--------------------------------------------------
@@ -403,26 +403,26 @@ POST _delete_by_query/r1A2WoRbTwKZ516z6NEs5A:36619/_rethrottle?requests_per_seco
403403

404404
The task ID can be found using the <<tasks,tasks API>>.
405405

406-
Just like when setting it on the `_delete_by_query` API `requests_per_second`
406+
Just like when setting it on the delete by query API, `requests_per_second`
407407
can be either `-1` to disable throttling or any decimal number
408408
like `1.7` or `12` to throttle to that level. Rethrottling that speeds up the
409409
query takes effect immediately but rethrotting that slows down the query will
410-
take effect on after completing the current batch. This prevents scroll
410+
take effect after completing the current batch. This prevents scroll
411411
timeouts.
412412

413413
[float]
414414
[[docs-delete-by-query-slice]]
415415
=== Slicing
416416

417-
Delete-by-query supports <<sliced-scroll>> to parallelize the deleting process.
417+
Delete by query supports <<sliced-scroll, sliced scroll>> to parallelize the deleting process.
418418
This parallelization can improve efficiency and provide a convenient way to
419419
break the request down into smaller parts.
420420

421421
[float]
422422
[[docs-delete-by-query-manual-slice]]
423-
==== Manually slicing
423+
==== Manual slicing
424424

425-
Slice a delete-by-query manually by providing a slice id and total number of
425+
Slice a delete by query manually by providing a slice id and total number of
426426
slices to each request:
427427

428428
[source,js]
@@ -498,7 +498,7 @@ Which results in a sensible `total` like this one:
498498
==== Automatic slicing
499499

500500
You can also let delete-by-query automatically parallelize using
501-
<<sliced-scroll>> to slice on `_id`. Use `slices` to specify the number of
501+
<<sliced-scroll, sliced scroll>> to slice on `_id`. Use `slices` to specify the number of
502502
slices to use:
503503

504504
[source,js]
@@ -575,8 +575,8 @@ be larger than others. Expect larger slices to have a more even distribution.
575575
are distributed proportionally to each sub-request. Combine that with the point
576576
above about distribution being uneven and you should conclude that the using
577577
`size` with `slices` might not result in exactly `size` documents being
578-
`_delete_by_query`ed.
579-
* Each sub-requests gets a slightly different snapshot of the source index
578+
deleted.
579+
* Each sub-request gets a slightly different snapshot of the source index
580580
though these are all taken at approximately the same time.
581581

582582
[float]
@@ -588,8 +588,8 @@ number for most indices. If you're slicing manually or otherwise tuning
588588
automatic slicing, use these guidelines.
589589

590590
Query performance is most efficient when the number of `slices` is equal to the
591-
number of shards in the index. If that number is large, (for example,
592-
500) choose a lower number as too many `slices` will hurt performance. Setting
591+
number of shards in the index. If that number is large (for example,
592+
500), choose a lower number as too many `slices` will hurt performance. Setting
593593
`slices` higher than the number of shards generally does not improve efficiency
594594
and adds overhead.
595595

0 commit comments

Comments
 (0)