Skip to content

Commit 040476a

Browse files
committed
Merge branch 'master' into replicated-closed-indices
2 parents 03335b2 + 8f56e37 commit 040476a

File tree

92 files changed

+2016
-1092
lines changed

Some content is hidden

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

92 files changed

+2016
-1092
lines changed

TESTING.asciidoc

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@ following:
1616
./gradlew assemble
1717
-----------------------------
1818

19+
To create a platform-specific build including the x-pack modules, use the
20+
following depending on your operating system:
21+
22+
-----------------------------
23+
./gradlew :distribution:archives:linux-tar:assemble --parallel
24+
./gradlew :distribution:archives:darwin-tar:assemble --parallel
25+
./gradlew :distribution:archives:windows-zip:assemble --parallel
26+
-----------------------------
27+
1928
=== Running Elasticsearch from a checkout
2029

2130
In order to run Elasticsearch from source without building a package, you can
@@ -385,12 +394,6 @@ Unfortunately we're not able to provide boxes for them in open source use
385394
because of licensing issues. Any Virtualbox image that has WinRM and Powershell
386395
enabled for remote users should work.
387396

388-
Testing on Windows requires the https://github.com/criteo/vagrant-winrm[vagrant-winrm] plugin.
389-
390-
------------------------------------
391-
vagrant plugin install vagrant-winrm
392-
------------------------------------
393-
394397
Specify the image IDs of the Windows boxes to gradle with the following project
395398
properties. They can be set in `~/.gradle/gradle.properties` like
396399

build.gradle

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,10 @@ task verifyVersions {
159159
* the enabled state of every bwc task. It should be set back to true
160160
* after the backport of the backcompat code is complete.
161161
*/
162-
final boolean bwc_tests_enabled = true
162+
163+
boolean bwc_tests_enabled = true
163164
final String bwc_tests_disabled_issue = "" /* place a PR link here when committing bwc changes */
165+
164166
if (bwc_tests_enabled == false) {
165167
if (bwc_tests_disabled_issue.isEmpty()) {
166168
throw new GradleException("bwc_tests_disabled_issue must be set when bwc_tests_enabled == false")
@@ -170,6 +172,17 @@ if (bwc_tests_enabled == false) {
170172
println "See ${bwc_tests_disabled_issue}"
171173
println "==========================================================="
172174
}
175+
if (project.gradle.startParameter.taskNames.find { it.startsWith("checkPart") } != null) {
176+
// Disable BWC tests for checkPart* tasks as it's expected that this will run un it's own check
177+
bwc_tests_enabled = false
178+
}
179+
if (project.gradle.startParameter.taskNames.contains("bwcTestSnapshots") && bwc_tests_enabled == false) {
180+
throw new GradleException("BWC tests are disabled. " +
181+
"This can happen if a branch happened to be created when they were disabled and can be solved by mergin at" +
182+
"least to the commit on the parent branch that re-enabled them"
183+
)
184+
}
185+
173186
subprojects {
174187
ext.bwc_tests_enabled = bwc_tests_enabled
175188
}

buildSrc/src/main/groovy/org/elasticsearch/gradle/vagrant/VagrantTestPlugin.groovy

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -547,11 +547,7 @@ class VagrantTestPlugin implements Plugin<Project> {
547547
project.gradle.removeListener(batsPackagingReproListener)
548548
}
549549
if (project.extensions.esvagrant.boxes.contains(box)) {
550-
// these tests are temporarily disabled for suse boxes while we debug an issue
551-
// https://github.com/elastic/elasticsearch/issues/30295
552-
if (box.equals("opensuse-42") == false && box.equals("sles-12") == false) {
553-
packagingTest.dependsOn(batsPackagingTest)
554-
}
550+
packagingTest.dependsOn(batsPackagingTest)
555551
}
556552
}
557553

@@ -590,11 +586,7 @@ class VagrantTestPlugin implements Plugin<Project> {
590586
project.gradle.removeListener(javaPackagingReproListener)
591587
}
592588
if (project.extensions.esvagrant.boxes.contains(box)) {
593-
// these tests are temporarily disabled for suse boxes while we debug an issue
594-
// https://github.com/elastic/elasticsearch/issues/30295
595-
if (box.equals("opensuse-42") == false && box.equals("sles-12") == false) {
596-
packagingTest.dependsOn(javaPackagingTest)
597-
}
589+
packagingTest.dependsOn(javaPackagingTest)
598590
}
599591

600592
/*

docs/reference/aggregations/bucket/daterange-aggregation.asciidoc

Lines changed: 135 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -110,68 +110,149 @@ bucket, as if they had a date value of "1899-12-31".
110110
==== Date Format/Pattern
111111

112112
NOTE: this information was copied from
113-
http://www.joda.org/joda-time/apidocs/org/joda/time/format/DateTimeFormat.html[JodaDate]
113+
https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html[DateTimeFormatter]
114114

115115
All ASCII letters are reserved as format pattern letters, which are defined
116116
as follows:
117117

118118
[options="header"]
119119
|=======
120-
|Symbol |Meaning |Presentation |Examples
121-
|G |era |text |AD
122-
|C |century of era (>=0) |number |20
123-
|Y |year of era (>=0) |year |1996
124-
125-
|x |weekyear |year |1996
126-
|w |week of weekyear |number |27
127-
|e |day of week |number |2
128-
|E |day of week |text |Tuesday; Tue
129-
130-
|y |year |year |1996
131-
|D |day of year |number |189
132-
|M |month of year |month |July; Jul; 07
133-
|d |day of month |number |10
134-
135-
|a |halfday of day |text |PM
136-
|K |hour of halfday (0~11) |number |0
137-
|h |clockhour of halfday (1~12) |number |12
138-
139-
|H |hour of day (0~23) |number |0
140-
|k |clockhour of day (1~24) |number |24
141-
|m |minute of hour |number |30
142-
|s |second of minute |number |55
143-
|S |fraction of second |number |978
144-
145-
|z |time zone |text |Pacific Standard Time; PST
146-
|Z |time zone offset/id |zone |-0800; -08:00; America/Los_Angeles
147-
148-
|' |escape for text |delimiter
149-
|'' |single quote |literal |'
120+
|Symbol |Meaning |Presentation |Examples
121+
|G |era |text |AD; Anno Domini; A
122+
|u |year |year |2004; 04
123+
|y |year-of-era |year |2004; 04
124+
|D |day-of-year |number |189
125+
|M/L |month-of-year |number/text |7; 07; Jul; July; J
126+
|d |day-of-month |number |10
127+
128+
|Q/q |quarter-of-year |number/text |3; 03; Q3; 3rd quarter
129+
|Y |week-based-year |year |1996; 96
130+
|w |week-of-week-based-year |number |27
131+
|W |week-of-month |number |4
132+
|E |day-of-week |text |Tue; Tuesday; T
133+
|e/c |localized day-of-week |number/text |2; 02; Tue; Tuesday; T
134+
|F |week-of-month |number |3
135+
136+
|a |am-pm-of-day |text |PM
137+
|h |clock-hour-of-am-pm (1-12) |number |12
138+
|K |hour-of-am-pm (0-11) |number |0
139+
|k |clock-hour-of-am-pm (1-24) |number |0
140+
141+
|H |hour-of-day (0-23) |number |0
142+
|m |minute-of-hour |number |30
143+
|s |second-of-minute |number |55
144+
|S |fraction-of-second |fraction |978
145+
|A |milli-of-day |number |1234
146+
|n |nano-of-second |number |987654321
147+
|N |nano-of-day |number |1234000000
148+
149+
|V |time-zone ID |zone-id |America/Los_Angeles; Z; -08:30
150+
|z |time-zone name |zone-name |Pacific Standard Time; PST
151+
|O |localized zone-offset |offset-O |GMT+8; GMT+08:00; UTC-08:00;
152+
|X |zone-offset 'Z' for zero |offset-X |Z; -08; -0830; -08:30; -083015; -08:30:15;
153+
|x |zone-offset |offset-x |+0000; -08; -0830; -08:30; -083015; -08:30:15;
154+
|Z |zone-offset |offset-Z |+0000; -0800; -08:00;
155+
156+
|p |pad next |pad modifier |1
157+
|' |escape for text |delimiter
158+
|'' |single quote |literal |'
159+
|[ |optional section start
160+
|] |optional section end
161+
|# |reserved for future use
162+
|{ |reserved for future use
163+
|} |reserved for future use
150164
|=======
151165

152-
The count of pattern letters determine the format.
166+
The count of pattern letters determines the format.
167+
168+
Text:: The text style is determined based on the number of pattern letters
169+
used. Less than 4 pattern letters will use the short form. Exactly 4
170+
pattern letters will use the full form. Exactly 5 pattern letters will use
171+
the narrow form. Pattern letters `L`, `c`, and `q` specify the stand-alone
172+
form of the text styles.
173+
174+
Number:: If the count of letters is one, then the value is output using
175+
the minimum number of digits and without padding. Otherwise, the count of
176+
digits is used as the width of the output field, with the value
177+
zero-padded as necessary. The following pattern letters have constraints
178+
on the count of letters. Only one letter of `c` and `F` can be specified.
179+
Up to two letters of `d`, `H`, `h`, `K`, `k`, `m`, and `s` can be
180+
specified. Up to three letters of `D` can be specified.
181+
182+
Number/Text:: If the count of pattern letters is 3 or greater, use the
183+
Text rules above. Otherwise use the Number rules above.
184+
185+
Fraction:: Outputs the nano-of-second field as a fraction-of-second. The
186+
nano-of-second value has nine digits, thus the count of pattern letters is
187+
from 1 to 9. If it is less than 9, then the nano-of-second value is
188+
truncated, with only the most significant digits being output.
189+
190+
Year:: The count of letters determines the minimum field width below which
191+
padding is used. If the count of letters is two, then a reduced two digit
192+
form is used. For printing, this outputs the rightmost two digits. For
193+
parsing, this will parse using the base value of 2000, resulting in a year
194+
within the range 2000 to 2099 inclusive. If the count of letters is less
195+
than four (but not two), then the sign is only output for negative years
196+
as per `SignStyle.NORMAL`. Otherwise, the sign is output if the pad width is
197+
exceeded, as per `SignStyle.EXCEEDS_PAD`.
198+
199+
ZoneId:: This outputs the time-zone ID, such as `Europe/Paris`. If the
200+
count of letters is two, then the time-zone ID is output. Any other count
201+
of letters throws `IllegalArgumentException`.
202+
203+
Zone names:: This outputs the display name of the time-zone ID. If the
204+
count of letters is one, two or three, then the short name is output. If
205+
the count of letters is four, then the full name is output. Five or more
206+
letters throws `IllegalArgumentException`.
207+
208+
Offset X and x:: This formats the offset based on the number of pattern
209+
letters. One letter outputs just the hour, such as `+01`, unless the
210+
minute is non-zero in which case the minute is also output, such as
211+
`+0130`. Two letters outputs the hour and minute, without a colon, such as
212+
`+0130`. Three letters outputs the hour and minute, with a colon, such as
213+
`+01:30`. Four letters outputs the hour and minute and optional second,
214+
without a colon, such as `+013015`. Five letters outputs the hour and
215+
minute and optional second, with a colon, such as `+01:30:15`. Six or
216+
more letters throws `IllegalArgumentException`. Pattern letter `X` (upper
217+
case) will output `Z` when the offset to be output would be zero,
218+
whereas pattern letter `x` (lower case) will output `+00`, `+0000`, or
219+
`+00:00`.
220+
221+
Offset O:: This formats the localized offset based on the number of
222+
pattern letters. One letter outputs the short form of the localized
223+
offset, which is localized offset text, such as `GMT`, with hour without
224+
leading zero, optional 2-digit minute and second if non-zero, and colon,
225+
for example `GMT+8`. Four letters outputs the full form, which is
226+
localized offset text, such as `GMT, with 2-digit hour and minute
227+
field, optional second field if non-zero, and colon, for example
228+
`GMT+08:00`. Any other count of letters throws
229+
`IllegalArgumentException`.
230+
231+
Offset Z:: This formats the offset based on the number of pattern letters.
232+
One, two or three letters outputs the hour and minute, without a colon,
233+
such as `+0130`. The output will be `+0000` when the offset is zero.
234+
Four letters outputs the full form of localized offset, equivalent to
235+
four letters of Offset-O. The output will be the corresponding localized
236+
offset text if the offset is zero. Five letters outputs the hour,
237+
minute, with optional second if non-zero, with colon. It outputs `Z` if
238+
the offset is zero. Six or more letters throws IllegalArgumentException.
239+
240+
Optional section:: The optional section markers work exactly like calling
241+
`DateTimeFormatterBuilder.optionalStart()` and
242+
`DateTimeFormatterBuilder.optionalEnd()`.
243+
244+
Pad modifier:: Modifies the pattern that immediately follows to be padded
245+
with spaces. The pad width is determined by the number of pattern letters.
246+
This is the same as calling `DateTimeFormatterBuilder.padNext(int)`.
247+
248+
For example, `ppH` outputs the hour-of-day padded on the left with spaces to a width of 2.
249+
250+
Any unrecognized letter is an error. Any non-letter character, other than
251+
`[`, `]`, `{`, `}`, `#` and the single quote will be output directly.
252+
Despite this, it is recommended to use single quotes around all characters
253+
that you want to output directly to ensure that future changes do not
254+
break your application.
153255

154-
Text:: If the number of pattern letters is 4 or more, the full form is used;
155-
otherwise a short or abbreviated form is used if available.
156-
157-
Number:: The minimum number of digits. Shorter numbers are zero-padded to
158-
this amount.
159-
160-
Year:: Numeric presentation for year and weekyear fields are handled
161-
specially. For example, if the count of 'y' is 2, the year will be displayed
162-
as the zero-based year of the century, which is two digits.
163-
164-
Month:: 3 or over, use text, otherwise use number.
165-
166-
Zone:: 'Z' outputs offset without a colon, 'ZZ' outputs the offset with a
167-
colon, 'ZZZ' or more outputs the zone id.
168-
169-
Zone names:: Time zone names ('z') cannot be parsed.
170-
171-
Any characters in the pattern that are not in the ranges of ['a'..'z'] and
172-
['A'..'Z'] will be treated as quoted text. For instance, characters like ':',
173-
'.', ' ', '#' and '?' will appear in the resulting time text even they are
174-
not embraced within single quotes.
175256

176257
[[time-zones]]
177258
==== Time zone in date range aggregations
@@ -180,8 +261,7 @@ Dates can be converted from another time zone to UTC by specifying the
180261
`time_zone` parameter.
181262

182263
Time zones may either be specified as an ISO 8601 UTC offset (e.g. +01:00 or
183-
-08:00) or as one of the http://www.joda.org/joda-time/timezones.html [time
184-
zone ids] from the TZ database.
264+
-08:00) or as one of the time zone ids from the TZ database.
185265

186266
The `time_zone` parameter is also applied to rounding in date math expressions.
187267
As an example, to round to the beginning of the day in the CET time zone, you

docs/reference/docs/bulk.asciidoc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ 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
47-
index and type exists already, whereas index will add or replace a
47+
index exists already, whereas index will add or replace a
4848
document as necessary). `delete` does not expect a source on the
4949
following line, and has the same semantics as the standard delete API.
5050
`update` expects that the partial doc, upsert and script and its options
@@ -172,9 +172,8 @@ The result of this bulk operation is:
172172
// TESTRESPONSE[s/"_seq_no" : 3/"_seq_no" : $body.items.3.update._seq_no/]
173173
// TESTRESPONSE[s/"_primary_term" : 4/"_primary_term" : $body.items.3.update._primary_term/]
174174

175-
The endpoints are `/_bulk`, `/{index}/_bulk`, and `{index}/{type}/_bulk`.
176-
When the index or the index/type are provided, they will be used by
177-
default on bulk items that don't provide them explicitly.
175+
The endpoints are `/_bulk` and `/{index}/_bulk`. When the index is provided, it
176+
will be used by default on bulk items that don't provide it explicitly.
178177

179178
A note on the format. The idea here is to make processing of this as
180179
fast as possible. As some of the actions will be redirected to other

docs/reference/ingest/processors/date-index-name.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,9 @@ understands this to mean `2016-04-01` as is explained in the <<date-math-index-n
137137
| `field` | yes | - | The field to get the date or timestamp from.
138138
| `index_name_prefix` | no | - | A prefix of the index name to be prepended before the printed date. Supports <<accessing-template-fields,template snippets>>.
139139
| `date_rounding` | yes | - | How to round the date when formatting the date into the index name. Valid values are: `y` (year), `M` (month), `w` (week), `d` (day), `h` (hour), `m` (minute) and `s` (second). Supports <<accessing-template-fields,template snippets>>.
140-
| `date_formats` | no | yyyy-MM-dd'T'HH:mm:ss.SSSZ | An array of the expected date formats for parsing dates / timestamps in the document being preprocessed. Can be a Joda pattern or one of the following formats: ISO8601, UNIX, UNIX_MS, or TAI64N.
140+
| `date_formats` | no | yyyy-MM-dd'T'HH:mm:ss.SSSZ | An array of the expected date formats for parsing dates / timestamps in the document being preprocessed. Can be a java time pattern or one of the following formats: ISO8601, UNIX, UNIX_MS, or TAI64N.
141141
| `timezone` | no | UTC | The timezone to use when parsing the date and when date math index supports resolves expressions into concrete index names.
142142
| `locale` | no | ENGLISH | The locale to use when parsing the date from the document being preprocessed, relevant when parsing month names or week days.
143-
| `index_name_format` | no | yyyy-MM-dd | The format to be used when printing the parsed date into the index name. An valid Joda pattern is expected here. Supports <<accessing-template-fields,template snippets>>.
143+
| `index_name_format` | no | yyyy-MM-dd | The format to be used when printing the parsed date into the index name. An valid java time pattern is expected here. Supports <<accessing-template-fields,template snippets>>.
144144
include::common-options.asciidoc[]
145145
|======

docs/reference/ingest/processors/date.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ in the same order they were defined as part of the processor definition.
1414
| Name | Required | Default | Description
1515
| `field` | yes | - | The field to get the date from.
1616
| `target_field` | no | @timestamp | The field that will hold the parsed date.
17-
| `formats` | yes | - | An array of the expected date formats. Can be a Joda pattern or one of the following formats: ISO8601, UNIX, UNIX_MS, or TAI64N.
17+
| `formats` | yes | - | An array of the expected date formats. Can be a java time pattern or one of the following formats: ISO8601, UNIX, UNIX_MS, or TAI64N.
1818
| `timezone` | no | UTC | The timezone to use when parsing the date. Supports <<accessing-template-fields,template snippets>>.
1919
| `locale` | no | ENGLISH | The locale to use when parsing the date, relevant when parsing month names or week days. Supports <<accessing-template-fields,template snippets>>.
2020
include::common-options.asciidoc[]

docs/reference/mapping/params/format.asciidoc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ down to the nearest day.
3333
==== Custom date formats
3434

3535
Completely customizable date formats are supported. The syntax for these is explained
36-
http://www.joda.org/joda-time/apidocs/org/joda/time/format/DateTimeFormat.html[in the Joda docs].
36+
https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html[DateTimeFormatter docs].
3737

3838
[[built-in-date-formats]]
3939
==== Built In Formats
@@ -69,7 +69,6 @@ The following tables lists all the defaults ISO formats supported:
6969

7070
A generic ISO datetime parser where the date is mandatory and the time is
7171
optional.
72-
http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateOptionalTimeParser--[Full details here].
7372

7473
`basic_date`::
7574

0 commit comments

Comments
 (0)