Skip to content

Commit afa12cf

Browse files
committed
Merge branch 'master' into simplify-prefix-logger
* master: (1889 commits) Test: remove faling test that relies on merge order Log checkout so SHA is known Add link to community Rust Client (elastic#22897) "shard started" should show index and shard ID (elastic#25157) await fix testWithRandomException Change BWC versions on create index response Return the index name on a create index response Remove incorrect bwc branch logic from master Correctly format arrays in output [Test] Extending parsing checks for SearchResponse (elastic#25148) Scripting: Change keys for inline/stored scripts to source/id (elastic#25127) [Test] Add test for custom requests in High Level Rest Client (elastic#25106) nested: In case of a single type the _id field should be added to the nested document instead of _uid field. `type` and `id` are lost upon serialization of `Translog.Delete`. (elastic#24586) fix highlighting docs Fix NPE in token_count datatype with null value (elastic#25046) Remove the postings highlighter and make unified the default highlighter choice (elastic#25028) [Test] Adding test for parsing SearchShardFailure leniently (elastic#25144) Fix typo in shards.asciidoc (elastic#25143) List Hibernate Search (elastic#25145) ...
2 parents c6cc6a4 + 5cdbebe commit afa12cf

File tree

5,280 files changed

+203618
-116137
lines changed

Some content is hidden

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

5,280 files changed

+203618
-116137
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,46 @@
11
<!--
2-
GitHub is reserved for bug reports and feature requests. The best place
3-
to ask a general question is at the Elastic Discourse forums at
4-
https://discuss.elastic.co. If you are in fact posting a bug report or
5-
a feature request, please include one and only one of the below blocks
6-
in your new issue. Note that whether you're filing a bug report or a
7-
feature request, ensure that your submission is for an
8-
[OS that we support](https://www.elastic.co/support/matrix#show_os).
9-
Bug reports on an OS that we do not support or feature requests
10-
specific to an OS that we do not support will be closed.
11-
-->
122
13-
<!--
14-
If you are filing a bug report, please remove the below feature
15-
request block and provide responses for all of the below items.
3+
** Please read the guidelines below. **
4+
5+
Issues that do not follow these guidelines are likely to be closed.
6+
7+
1. GitHub is reserved for bug reports and feature requests. The best place to
8+
ask a general question is at the Elastic [forums](https://discuss.elastic.co).
9+
GitHub is not the place for general questions.
10+
11+
2. Is this bug report or feature request for a supported OS? If not, it
12+
is likely to be closed. See https://www.elastic.co/support/matrix#show_os
13+
14+
3. Please fill out EITHER the feature request block or the bug report block
15+
below, and delete the other block.
16+
1617
-->
1718

19+
<!-- Feature request -->
20+
21+
**Describe the feature**:
22+
23+
<!-- Bug report -->
24+
1825
**Elasticsearch version**:
1926

2027
**Plugins installed**: []
2128

22-
**JVM version**:
29+
**JVM version** (`java -version`):
2330

24-
**OS version**:
31+
**OS version** (`uname -a` if on a Unix-like system):
2532

2633
**Description of the problem including expected versus actual behavior**:
2734

2835
**Steps to reproduce**:
36+
37+
Please include a *minimal* but *complete* recreation of the problem, including
38+
(e.g.) index creation, mappings, settings, query etc. The easier you make for
39+
us to reproduce it, the more likely that somebody will take the time to look at it.
40+
2941
1.
3042
2.
3143
3.
3244

3345
**Provide logs (if relevant)**:
3446

35-
<!--
36-
If you are filing a feature request, please remove the above bug
37-
report block and provide responses for all of the below items.
38-
-->
39-
40-
**Describe the feature**:

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ attention.
1111
- If submitting code, have you built your formula locally prior to submission with `gradle check`?
1212
- If submitting code, is your pull request against master? Unless there is a good reason otherwise, we prefer pull requests against master and will backport as needed.
1313
- If submitting code, have you checked that your submission is for an [OS that we support](https://www.elastic.co/support/matrix#show_os)?
14+
- If you are submitting this code for a class then read our [policy](https://github.com/elastic/elasticsearch/blob/master/CONTRIBUTING.md#contributing-as-part-of-a-class) for that.

CONTRIBUTING.md

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ Contributing to the Elasticsearch codebase
8888
**Repository:** [https://github.com/elastic/elasticsearch](https://github.com/elastic/elasticsearch)
8989

9090
Make sure you have [Gradle](http://gradle.org) installed, as
91-
Elasticsearch uses it as its build system. Gradle must be version 2.13 _exactly_ in
92-
order to build successfully.
91+
Elasticsearch uses it as its build system. Gradle must be at least
92+
version 3.3 in order to build successfully.
9393

9494
Eclipse users can automatically configure their IDE: `gradle eclipse`
9595
then `File: Import: Existing Projects into Workspace`. Select the
@@ -101,7 +101,11 @@ IntelliJ users can automatically configure their IDE: `gradle idea`
101101
then `File->New Project From Existing Sources`. Point to the root of
102102
the source directory, select
103103
`Import project from external model->Gradle`, enable
104-
`Use auto-import`.
104+
`Use auto-import`. Additionally, in order to run tests directly from
105+
IDEA 2017.1 and above it is required to disable IDEA run launcher,
106+
which can be achieved by adding `-Didea.no.launcher=true`
107+
[JVM option](https://intellij-support.jetbrains.com/hc/en-us/articles/206544869-Configuring-JVM-options-and-platform-properties)
108+
105109

106110
The Elasticsearch codebase makes heavy use of Java `assert`s and the
107111
test runner requires that assertions be enabled within the JVM. This
@@ -139,3 +143,32 @@ Before submitting your changes, run the test suite to make sure that nothing is
139143
```sh
140144
gradle check
141145
```
146+
147+
Contributing as part of a class
148+
-------------------------------
149+
In general Elasticsearch is happy to accept contributions that were created as
150+
part of a class but strongly advise against making the contribution as part of
151+
the class. So if you have code you wrote for a class feel free to submit it.
152+
153+
Please, please, please do not assign contributing to Elasticsearch as part of a
154+
class. If you really want to assign writing code for Elasticsearch as an
155+
assignment then the code contributions should be made to your private clone and
156+
opening PRs against the primary Elasticsearch clone must be optional, fully
157+
voluntary, not for a grade, and without any deadlines.
158+
159+
Because:
160+
161+
* While the code review process is likely very educational, it can take wildly
162+
varying amounts of time depending on who is available, where the change is, and
163+
how deep the change is. There is no way to predict how long it will take unless
164+
we rush.
165+
* We do not rush reviews without a very, very good reason. Class deadlines
166+
aren't a good enough reason for us to rush reviews.
167+
* We deeply discourage opening a PR you don't intend to work through the entire
168+
code review process because it wastes our time.
169+
* We don't have the capacity to absorb an entire class full of new contributors,
170+
especially when they are unlikely to become long time contributors.
171+
172+
Finally, we require that you run `gradle check` before submitting a
173+
non-documentation contribution. This is mentioned above, but it is worth
174+
repeating in this section because it has come up in this context.

NOTICE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Elasticsearch
2-
Copyright 2009-2016 Elasticsearch
2+
Copyright 2009-2017 Elasticsearch
33

44
This product includes software developed by The Apache Software
55
Foundation (http://www.apache.org/).

README.textile

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,16 @@ h3. Indexing
5050
Let's try and index some twitter like information. First, let's create a twitter user, and add some tweets (the @twitter@ index will be created automatically):
5151

5252
<pre>
53-
curl -XPUT 'http://localhost:9200/twitter/user/kimchy?pretty' -d '{ "name" : "Shay Banon" }'
53+
curl -XPUT 'http://localhost:9200/twitter/user/kimchy?pretty' -H 'Content-Type: application/json' -d '{ "name" : "Shay Banon" }'
5454

55-
curl -XPUT 'http://localhost:9200/twitter/tweet/1?pretty' -d '
55+
curl -XPUT 'http://localhost:9200/twitter/tweet/1?pretty' -H 'Content-Type: application/json' -d '
5656
{
5757
"user": "kimchy",
5858
"post_date": "2009-11-15T13:12:00",
5959
"message": "Trying out Elasticsearch, so far so good?"
6060
}'
6161

62-
curl -XPUT 'http://localhost:9200/twitter/tweet/2?pretty' -d '
62+
curl -XPUT 'http://localhost:9200/twitter/tweet/2?pretty' -H 'Content-Type: application/json' -d '
6363
{
6464
"user": "kimchy",
6565
"post_date": "2009-11-15T14:12:12",
@@ -87,7 +87,7 @@ curl -XGET 'http://localhost:9200/twitter/tweet/_search?q=user:kimchy&pretty=tru
8787
We can also use the JSON query language Elasticsearch provides instead of a query string:
8888

8989
<pre>
90-
curl -XGET 'http://localhost:9200/twitter/tweet/_search?pretty=true' -d '
90+
curl -XGET 'http://localhost:9200/twitter/tweet/_search?pretty=true' -H 'Content-Type: application/json' -d '
9191
{
9292
"query" : {
9393
"match" : { "user": "kimchy" }
@@ -98,7 +98,7 @@ curl -XGET 'http://localhost:9200/twitter/tweet/_search?pretty=true' -d '
9898
Just for kicks, let's get all the documents stored (we should see the user as well):
9999

100100
<pre>
101-
curl -XGET 'http://localhost:9200/twitter/_search?pretty=true' -d '
101+
curl -XGET 'http://localhost:9200/twitter/_search?pretty=true' -H 'Content-Type: application/json' -d '
102102
{
103103
"query" : {
104104
"match_all" : {}
@@ -109,7 +109,7 @@ curl -XGET 'http://localhost:9200/twitter/_search?pretty=true' -d '
109109
We can also do range search (the @postDate@ was automatically identified as date)
110110

111111
<pre>
112-
curl -XGET 'http://localhost:9200/twitter/_search?pretty=true' -d '
112+
curl -XGET 'http://localhost:9200/twitter/_search?pretty=true' -H 'Content-Type: application/json' -d '
113113
{
114114
"query" : {
115115
"range" : {
@@ -130,16 +130,16 @@ Elasticsearch supports multiple indices, as well as multiple types per index. In
130130
Another way to define our simple twitter system is to have a different index per user (note, though that each index has an overhead). Here is the indexing curl's in this case:
131131

132132
<pre>
133-
curl -XPUT 'http://localhost:9200/kimchy/info/1?pretty' -d '{ "name" : "Shay Banon" }'
133+
curl -XPUT 'http://localhost:9200/kimchy/info/1?pretty' -H 'Content-Type: application/json' -d '{ "name" : "Shay Banon" }'
134134

135-
curl -XPUT 'http://localhost:9200/kimchy/tweet/1?pretty' -d '
135+
curl -XPUT 'http://localhost:9200/kimchy/tweet/1?pretty' -H 'Content-Type: application/json' -d '
136136
{
137137
"user": "kimchy",
138138
"post_date": "2009-11-15T13:12:00",
139139
"message": "Trying out Elasticsearch, so far so good?"
140140
}'
141141

142-
curl -XPUT 'http://localhost:9200/kimchy/tweet/2?pretty' -d '
142+
curl -XPUT 'http://localhost:9200/kimchy/tweet/2?pretty' -H 'Content-Type: application/json' -d '
143143
{
144144
"user": "kimchy",
145145
"post_date": "2009-11-15T14:12:12",
@@ -152,7 +152,7 @@ The above will index information into the @kimchy@ index, with two types, @info@
152152
Complete control on the index level is allowed. As an example, in the above case, we would want to change from the default 5 shards with 1 replica per index, to only 1 shard with 1 replica per index (== per twitter user). Here is how this can be done (the configuration can be in yaml as well):
153153

154154
<pre>
155-
curl -XPUT http://localhost:9200/another_user?pretty -d '
155+
curl -XPUT http://localhost:9200/another_user?pretty -H 'Content-Type: application/json' -d '
156156
{
157157
"index" : {
158158
"number_of_shards" : 1,
@@ -165,7 +165,7 @@ Search (and similar operations) are multi index aware. This means that we can ea
165165
index (twitter user), for example:
166166

167167
<pre>
168-
curl -XGET 'http://localhost:9200/kimchy,another_user/_search?pretty=true' -d '
168+
curl -XGET 'http://localhost:9200/kimchy,another_user/_search?pretty=true' -H 'Content-Type: application/json' -d '
169169
{
170170
"query" : {
171171
"match_all" : {}
@@ -176,7 +176,7 @@ curl -XGET 'http://localhost:9200/kimchy,another_user/_search?pretty=true' -d '
176176
Or on all the indices:
177177

178178
<pre>
179-
curl -XGET 'http://localhost:9200/_search?pretty=true' -d '
179+
curl -XGET 'http://localhost:9200/_search?pretty=true' -H 'Content-Type: application/json' -d '
180180
{
181181
"query" : {
182182
"match_all" : {}
@@ -200,7 +200,7 @@ We have just covered a very small portion of what Elasticsearch is all about. Fo
200200

201201
h3. Building from Source
202202

203-
Elasticsearch uses "Gradle":https://gradle.org for its build system. You'll need to have version 2.13 of Gradle installed.
203+
Elasticsearch uses "Gradle":https://gradle.org for its build system. You'll need to have at least version 3.3 of Gradle installed.
204204

205205
In order to create a distribution, simply run the @gradle assemble@ command in the cloned directory.
206206

TESTING.asciidoc

Lines changed: 58 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,6 @@ run it using Gradle:
2525
gradle run
2626
-------------------------------------
2727

28-
or to attach a remote debugger, run it as:
29-
30-
-------------------------------------
31-
gradle run --debug-jvm
32-
-------------------------------------
33-
3428
=== Test case filtering.
3529

3630
- `tests.class` is a class-filtering shell-like glob pattern,
@@ -351,24 +345,23 @@ VM running trusty by running
351345

352346
These are the linux flavors the Vagrantfile currently supports:
353347

354-
* ubuntu-1204 aka precise
355348
* ubuntu-1404 aka trusty
356349
* ubuntu-1604 aka xenial
357350
* debian-8 aka jessie, the current debian stable distribution
358351
* centos-6
359352
* centos-7
360-
* fedora-24
353+
* fedora-25
361354
* oel-6 aka Oracle Enterprise Linux 6
362355
* oel-7 aka Oracle Enterprise Linux 7
363356
* sles-12
364-
* opensuse-13
357+
* opensuse-42 aka Leap
365358

366359
We're missing the following from the support matrix because there aren't high
367360
quality boxes available in vagrant atlas:
368361

369362
* sles-11
370363

371-
We're missing the follow because our tests are very linux/bash centric:
364+
We're missing the following because our tests are very linux/bash centric:
372365

373366
* Windows Server 2012
374367

@@ -424,21 +417,59 @@ sudo -E bats $BATS_TESTS/*rpm*.bats
424417
If you wanted to retest all the release artifacts on a single VM you could:
425418

426419
-------------------------------------------------
427-
gradle vagrantSetUp
428-
vagrant up ubuntu-1404 --provider virtualbox && vagrant ssh ubuntu-1404
420+
gradle setupBats
421+
cd qa/vagrant; vagrant up ubuntu-1404 --provider virtualbox && vagrant ssh ubuntu-1404
429422
cd $BATS_ARCHIVES
430423
sudo -E bats $BATS_TESTS/*.bats
431424
-------------------------------------------------
432425

426+
You can also use Gradle to prepare the test environment and then starts a single VM:
427+
428+
-------------------------------------------------
429+
gradle vagrantFedora25#up
430+
-------------------------------------------------
431+
432+
Or any of vagrantCentos6#up, vagrantCentos7#up, vagrantDebian8#up,
433+
vagrantFedora25#up, vagrantOel6#up, vagrantOel7#up, vagrantOpensuse13#up,
434+
vagrantSles12#up, vagrantUbuntu1404#up, vagrantUbuntu1604#up.
435+
436+
Once up, you can then connect to the VM using SSH from the elasticsearch directory:
437+
438+
-------------------------------------------------
439+
vagrant ssh fedora-25
440+
-------------------------------------------------
441+
442+
Or from another directory:
443+
444+
-------------------------------------------------
445+
VAGRANT_CWD=/path/to/elasticsearch vagrant ssh fedora-25
446+
-------------------------------------------------
447+
433448
Note: Starting vagrant VM outside of the elasticsearch folder requires to
434449
indicates the folder that contains the Vagrantfile using the VAGRANT_CWD
435-
environment variable:
450+
environment variable.
451+
452+
== Testing backwards compatibility
453+
454+
Backwards compatibility tests exist to test upgrading from each supported version
455+
to the current version. To run all backcompat tests use:
456+
457+
-------------------------------------------------
458+
gradle bwcTest
459+
-------------------------------------------------
460+
461+
A specific version can be tested as well. For example, to test backcompat with
462+
version 5.3.2 run:
436463

437464
-------------------------------------------------
438-
gradle vagrantSetUp
439-
VAGRANT_CWD=/path/to/elasticsearch vagrant up centos-7 --provider virtualbox
465+
gradle v5.3.2#bwcTest
440466
-------------------------------------------------
441467

468+
When running `gradle check`, some minimal backcompat checks are run. Which version
469+
is tested depends on the branch. On master, this will test against the current
470+
stable branch. On the stable branch, it will test against the latest release
471+
branch. Finally, on a release branch, it will test against the most recent release.
472+
442473
== Coverage analysis
443474

444475
Tests can be run instrumented with jacoco to produce a coverage report in
@@ -462,7 +493,7 @@ Combined (Unit+Integration) coverage:
462493
mvn -Dtests.coverage verify jacoco:report
463494
---------------------------------------------------------------------------
464495

465-
== Debugging from an IDE
496+
== Launching and debugging from an IDE
466497

467498
If you want to run elasticsearch from your IDE, the `gradle run` task
468499
supports a remote debugging option:
@@ -471,6 +502,17 @@ supports a remote debugging option:
471502
gradle run --debug-jvm
472503
---------------------------------------------------------------------------
473504

505+
== Debugging remotely from an IDE
506+
507+
If you want to run Elasticsearch and be able to remotely attach the process
508+
for debugging purposes from your IDE, can start Elasticsearch using `ES_JAVA_OPTS`:
509+
510+
---------------------------------------------------------------------------
511+
ES_JAVA_OPTS="-Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=4000,suspend=y" ./bin/elasticsearch
512+
---------------------------------------------------------------------------
513+
514+
Read your IDE documentation for how to attach a debugger to a JVM process.
515+
474516
== Building with extra plugins
475517
Additional plugins may be built alongside elasticsearch, where their
476518
dependency on elasticsearch will be substituted with the local elasticsearch
@@ -482,4 +524,3 @@ included as part of the build by checking the projects of the build.
482524
---------------------------------------------------------------------------
483525
gradle projects
484526
---------------------------------------------------------------------------
485-

0 commit comments

Comments
 (0)