Skip to content

Commit 63c3656

Browse files
author
Yogesh Gaikwad
committed
Merge branch 'master' into fix/28953
2 parents 33d78c4 + bddf9df commit 63c3656

File tree

145 files changed

+1576
-215
lines changed

Some content is hidden

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

145 files changed

+1576
-215
lines changed

buildSrc/src/main/resources/forbidden/es-all-signatures.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,5 @@ java.nio.channels.SocketChannel#connect(java.net.SocketAddress)
4848
# org.elasticsearch.common.Booleans#parseBoolean(java.lang.String) directly on the string.
4949
@defaultMessage use org.elasticsearch.common.Booleans#parseBoolean(java.lang.String)
5050
java.lang.Boolean#getBoolean(java.lang.String)
51+
52+
org.apache.lucene.util.IOUtils @ use @org.elasticsearch.core.internal.io instead

distribution/build.gradle

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,12 @@ subprojects {
265265
'def': "#-XX:HeapDumpPath=/heap/dump/path"
266266
],
267267

268+
'error.file': [
269+
'deb': "-XX:ErrorFile=/var/log/elasticsearch/hs_err_pid%p.log",
270+
'rpm': "-XX:ErrorFile=/var/log/elasticsearch/hs_err_pid%p.log",
271+
'def': "#-XX:ErrorFile=/error/file/path"
272+
],
273+
268274
'stopping.timeout': [
269275
'rpm': 86400,
270276
],

distribution/packages/src/common/scripts/postinst

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -95,19 +95,15 @@ chown -R root:elasticsearch /etc/elasticsearch
9595
chmod g+s /etc/elasticsearch
9696
chmod 0750 /etc/elasticsearch
9797

98-
if [ -f /etc/default/elasticsearch ]; then
99-
chown root:elasticsearch /etc/default/elasticsearch
98+
if [ -f ${path.env} ]; then
99+
chown root:elasticsearch ${path.env}
100100
fi
101101

102-
if [ -f /etc/sysconfig/elasticsearch ]; then
103-
chown root:elasticsearch /etc/sysconfig/elasticsearch
104-
fi
105-
106-
if [ ! -f "$ES_PATH_CONF"/elasticsearch.keystore ]; then
102+
if [ ! -f /etc/elasticsearch/elasticsearch.keystore ]; then
107103
/usr/share/elasticsearch/bin/elasticsearch-keystore create
108-
chown root:elasticsearch "$ES_PATH_CONF"/elasticsearch.keystore
109-
chmod 660 "$ES_PATH_CONF"/elasticsearch.keystore
110-
md5sum "$ES_PATH_CONF"/elasticsearch.keystore > "$ES_PATH_CONF"/.elasticsearch.keystore.initial_md5sum
104+
chown root:elasticsearch /etc/elasticsearch/elasticsearch.keystore
105+
chmod 660 /etc/elasticsearch/elasticsearch.keystore
106+
md5sum /etc/elasticsearch/elasticsearch.keystore > /etc/elasticsearch/.elasticsearch.keystore.initial_md5sum
111107
fi
112108

113109
${scripts.footer}

distribution/packages/src/common/scripts/prerm

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,6 @@ case "$1" in
4242
;;
4343
esac
4444

45-
ES_ENV_FILE="${path.env}"
46-
if [ -f "$ES_ENV_FILE" ]; then
47-
. "$ES_ENV_FILE"
48-
fi
49-
5045
# Stops the service
5146
if [ "$STOP_REQUIRED" = "true" ]; then
5247
echo -n "Stopping elasticsearch service..."
@@ -70,9 +65,9 @@ if [ "$STOP_REQUIRED" = "true" ]; then
7065
echo " OK"
7166
fi
7267

73-
if [ -f "$ES_PATH_CONF"/elasticsearch.keystore ]; then
74-
if md5sum --status -c "$ES_PATH_CONF"/.elasticsearch.keystore.initial_md5sum; then
75-
rm "$ES_PATH_CONF"/elasticsearch.keystore "$ES_PATH_CONF"/.elasticsearch.keystore.initial_md5sum
68+
if [ -f /etc/elasticsearch/elasticsearch.keystore ]; then
69+
if md5sum --status -c /etc/elasticsearch/.elasticsearch.keystore.initial_md5sum; then
70+
rm /etc/elasticsearch/elasticsearch.keystore /etc/elasticsearch/.elasticsearch.keystore.initial_md5sum
7671
fi
7772
fi
7873

distribution/src/config/jvm.options

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@
8181
# ensure the directory exists and has sufficient space
8282
${heap.dump.path}
8383

84+
# specify an alternative path for JVM fatal error logs
85+
${error.file}
86+
8487
## JDK 8 GC logging
8588

8689
8:-XX:+PrintGCDetails

distribution/tools/plugin-cli/src/main/java/org/elasticsearch/plugins/InstallPluginCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
import org.apache.lucene.search.spell.LevensteinDistance;
2626
import org.apache.lucene.util.CollectionUtil;
27-
import org.apache.lucene.util.IOUtils;
27+
import org.elasticsearch.core.internal.io.IOUtils;
2828
import org.elasticsearch.Version;
2929
import org.elasticsearch.bootstrap.JarHell;
3030
import org.elasticsearch.cli.EnvironmentAwareCommand;

distribution/tools/plugin-cli/src/main/java/org/elasticsearch/plugins/PluginCli.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
package org.elasticsearch.plugins;
2121

22-
import org.apache.lucene.util.IOUtils;
22+
import org.elasticsearch.core.internal.io.IOUtils;
2323
import org.elasticsearch.cli.Command;
2424
import org.elasticsearch.cli.LoggingAwareMultiCommand;
2525
import org.elasticsearch.cli.MultiCommand;

distribution/tools/plugin-cli/src/main/java/org/elasticsearch/plugins/RemovePluginCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
import joptsimple.OptionSet;
2323
import joptsimple.OptionSpec;
24-
import org.apache.lucene.util.IOUtils;
24+
import org.elasticsearch.core.internal.io.IOUtils;
2525
import org.elasticsearch.cli.EnvironmentAwareCommand;
2626
import org.elasticsearch.cli.ExitCodes;
2727
import org.elasticsearch.cli.Terminal;

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

Lines changed: 76 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
[[search-aggregations-bucket-daterange-aggregation]]
22
=== Date Range Aggregation
33

4-
A range aggregation that is dedicated for date values. The main difference between this aggregation and the normal <<search-aggregations-bucket-range-aggregation,range>> aggregation is that the `from` and `to` values can be expressed in <<date-math,Date Math>> expressions, and it is also possible to specify a date format by which the `from` and `to` response fields will be returned.
5-
Note that this aggregation includes the `from` value and excludes the `to` value for each range.
4+
A range aggregation that is dedicated for date values. The main difference
5+
between this aggregation and the normal
6+
<<search-aggregations-bucket-range-aggregation,range>>
7+
aggregation is that the `from` and `to` values can be expressed in
8+
<<date-math,Date Math>> expressions, and it is also possible to specify a date
9+
format by which the `from` and `to` response fields will be returned.
10+
Note that this aggregation includes the `from` value and excludes the `to` value
11+
for each range.
612

713
Example:
814

@@ -30,8 +36,9 @@ POST /sales/_search?size=0
3036
<1> < now minus 10 months, rounded down to the start of the month.
3137
<2> >= now minus 10 months, rounded down to the start of the month.
3238

33-
In the example above, we created two range buckets, the first will "bucket" all documents dated prior to 10 months ago and
34-
the second will "bucket" all documents dated since 10 months ago
39+
In the example above, we created two range buckets, the first will "bucket" all
40+
documents dated prior to 10 months ago and the second will "bucket" all
41+
documents dated since 10 months ago
3542

3643
Response:
3744

@@ -61,12 +68,52 @@ Response:
6168
--------------------------------------------------
6269
// TESTRESPONSE[s/\.\.\./"took": $body.took,"timed_out": false,"_shards": $body._shards,"hits": $body.hits,/]
6370

71+
==== Missing Values
72+
73+
The `missing` parameter defines how documents that are missing a value should
74+
be treated. By default they will be ignored but it is also possible to treat
75+
them as if they had a value. This is done by adding a set of fieldname :
76+
value mappings to specify default values per field.
77+
78+
[source,js]
79+
--------------------------------------------------
80+
POST /sales/_search?size=0
81+
{
82+
"aggs": {
83+
"range": {
84+
"date_range": {
85+
"field": "date",
86+
"missing": "1976/11/30",
87+
"ranges": [
88+
{
89+
"key": "Older",
90+
"to": "2016/02/01"
91+
}, <1>
92+
{
93+
"key": "Newer",
94+
"from": "2016/02/01",
95+
"to" : "now/d"
96+
}
97+
]
98+
}
99+
}
100+
}
101+
}
102+
--------------------------------------------------
103+
// CONSOLE
104+
// TEST[setup:sales]
105+
106+
<1> Documents without a value in the `date` field will be added to the "Older"
107+
bucket, as if they had a date value of "1899-12-31".
108+
64109
[[date-format-pattern]]
65110
==== Date Format/Pattern
66111

67-
NOTE: this information was copied from http://www.joda.org/joda-time/apidocs/org/joda/time/format/DateTimeFormat.html[JodaDate]
112+
NOTE: this information was copied from
113+
http://www.joda.org/joda-time/apidocs/org/joda/time/format/DateTimeFormat.html[JodaDate]
68114

69-
All ASCII letters are reserved as format pattern letters, which are defined as follows:
115+
All ASCII letters are reserved as format pattern letters, which are defined
116+
as follows:
70117

71118
[options="header"]
72119
|=======
@@ -104,30 +151,41 @@ All ASCII letters are reserved as format pattern letters, which are defined as f
104151

105152
The count of pattern letters determine the format.
106153

107-
Text:: If the number of pattern letters is 4 or more, the full form is used; otherwise a short or abbreviated form is used if available.
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.
108156

109-
Number:: The minimum number of digits. Shorter numbers are zero-padded to this amount.
157+
Number:: The minimum number of digits. Shorter numbers are zero-padded to
158+
this amount.
110159

111-
Year:: Numeric presentation for year and weekyear fields are handled specially. For example, if the count of 'y' is 2, the year will be displayed as the zero-based year of the century, which is two digits.
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.
112163

113164
Month:: 3 or over, use text, otherwise use number.
114165

115-
Zone:: 'Z' outputs offset without a colon, 'ZZ' outputs the offset with a colon, 'ZZZ' or more outputs the zone id.
166+
Zone:: 'Z' outputs offset without a colon, 'ZZ' outputs the offset with a
167+
colon, 'ZZZ' or more outputs the zone id.
116168

117169
Zone names:: Time zone names ('z') cannot be parsed.
118170

119-
Any characters in the pattern that are not in the ranges of ['a'..'z'] and ['A'..'Z'] will be treated as quoted text. For instance, characters like ':', '.', ' ', '#' and '?' will appear in the resulting time text even they are not embraced within single quotes.
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.
120175

121176
[[time-zones]]
122177
==== Time zone in date range aggregations
123178

124-
Dates can be converted from another time zone to UTC by specifying the `time_zone` parameter.
179+
Dates can be converted from another time zone to UTC by specifying the
180+
`time_zone` parameter.
125181

126-
Time zones may either be specified as an ISO 8601 UTC offset (e.g. +01:00 or -08:00) or as one of
127-
the http://www.joda.org/joda-time/timezones.html[time zone ids] from the TZ database.
182+
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.
128185

129-
The `time_zone` parameter is also applied to rounding in date math expressions. As an example,
130-
to round to the beginning of the day in the CET time zone, you can do the following:
186+
The `time_zone` parameter is also applied to rounding in date math expressions.
187+
As an example, to round to the beginning of the day in the CET time zone, you
188+
can do the following:
131189

132190
[source,js]
133191
--------------------------------------------------
@@ -156,7 +214,8 @@ POST /sales/_search?size=0
156214

157215
==== Keyed Response
158216

159-
Setting the `keyed` flag to `true` will associate a unique string key with each bucket and return the ranges as a hash rather than an array:
217+
Setting the `keyed` flag to `true` will associate a unique string key with each
218+
bucket and return the ranges as a hash rather than an array:
160219

161220
[source,js]
162221
--------------------------------------------------

docs/reference/index-modules/slowlog.asciidoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ index.search.slowlog.threshold.fetch.warn: 1s
2222
index.search.slowlog.threshold.fetch.info: 800ms
2323
index.search.slowlog.threshold.fetch.debug: 500ms
2424
index.search.slowlog.threshold.fetch.trace: 200ms
25+
26+
index.search.slowlog.level: info
2527
--------------------------------------------------
2628

2729
All of the above settings are _dynamic_ and are set per-index.

docs/reference/indices/put-mapping.asciidoc

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,14 @@
11
[[indices-put-mapping]]
22
== Put Mapping
33

4-
The PUT mapping API allows you to add a new type to an existing index, or add new
5-
fields to an existing type:
4+
The PUT mapping API allows you to add fields to an existing index or to change search only settings of existing fields.
65

76
[source,js]
87
--------------------------------------------------
98
PUT twitter <1>
109
{}
1110
1211
PUT twitter/_mapping/_doc <2>
13-
{
14-
"properties": {
15-
"name": {
16-
"type": "text"
17-
}
18-
}
19-
}
20-
21-
PUT twitter/_mapping/_doc <3>
2212
{
2313
"properties": {
2414
"email": {
@@ -29,8 +19,7 @@ PUT twitter/_mapping/_doc <3>
2919
--------------------------------------------------
3020
// CONSOLE
3121
<1> <<indices-create-index,Creates an index>> called `twitter` without any type mapping.
32-
<2> Uses the PUT mapping API to add a new mapping type called `user`.
33-
<3> Uses the PUT mapping API to add a new field called `email` to the `user` mapping type.
22+
<2> Uses the PUT mapping API to add a new field called `email` to the `_doc` mapping type.
3423

3524
More information on how to define type mappings can be found in the
3625
<<mapping,mapping>> section.
@@ -125,4 +114,3 @@ PUT my_index/_mapping/_doc
125114

126115
Each <<mapping-params,mapping parameter>> specifies whether or not its setting
127116
can be updated on an existing field.
128-

docs/reference/search/request/script-fields.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ GET /_search
2121
"test2" : {
2222
"script" : {
2323
"lang": "painless",
24-
"source": "doc['my_field_name'].value * factor",
24+
"source": "doc['my_field_name'].value * params.factor",
2525
"params" : {
2626
"factor" : 2.0
2727
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[[error-file-path]]
2+
=== JVM fatal error logs
3+
4+
The <<rpm,RPM>> and <<deb,Debian>> package distributions default to configuring
5+
the JVM to write fatal error logs to `/var/lib/elasticsearch`; these are logs
6+
produced by the JVM when it encounters a fatal error (e.g., a segmentation
7+
fault). If this path is not suitable for receiving logs, you should modify the
8+
entry `-XX:ErrorFile=/var/lib/elasticsearch/hs_err_pid%p.log` in
9+
<<jvm-options,`jvm.options`>> to an alternate path.
10+
11+
Note that the archive distributions do not configure the error file path by
12+
default. Instead, the JVM will default to writing to the working directory for
13+
the Elasticsearch process. If you wish to configure an error file path, you
14+
should modify the entry `#-XX:ErrorFile=/error/file/path` in
15+
<<jvm-options,`jvm.options`>> to remove the comment marker `#` and to specify an
16+
actual path.

0 commit comments

Comments
 (0)