From 9d5537d8741b0fbd850a929eaf1aead12ec0c60b Mon Sep 17 00:00:00 2001 From: Yannick Welsch Date: Thu, 12 May 2016 09:40:06 +0200 Subject: [PATCH 1/5] Invoke scripts from Gradle with the shell interpreter they choose --- .../org/elasticsearch/gradle/test/ClusterFormationTasks.groovy | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy index 34dde6e5dad..83dd1b7e4c5 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy @@ -418,8 +418,7 @@ class ClusterFormationTasks { // argument are wrapped in an ExecArgWrapper that escapes commas args execArgs.collect { a -> new EscapeCommaWrapper(arg: a) } } else { - executable 'sh' - args execArgs + commandLine execArgs } } } From 9ce96f57924aacaa8a624222a9b7966bfec22c11 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Thu, 12 May 2016 09:04:24 -0400 Subject: [PATCH 2/5] Add tests that packages depend on bash This commit adds bats tests that the RPM and Debian packages depend on bash. Relates #18292 --- .../src/test/resources/packaging/scripts/30_deb_package.bats | 4 ++++ .../src/test/resources/packaging/scripts/40_rpm_package.bats | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/qa/vagrant/src/test/resources/packaging/scripts/30_deb_package.bats b/qa/vagrant/src/test/resources/packaging/scripts/30_deb_package.bats index b1136c39b9f..1f4cdeeeb3f 100644 --- a/qa/vagrant/src/test/resources/packaging/scripts/30_deb_package.bats +++ b/qa/vagrant/src/test/resources/packaging/scripts/30_deb_package.bats @@ -40,6 +40,10 @@ setup() { export_elasticsearch_paths } +@test "[DEB] package depends on bash" { + dpkg -I elasticsearch-$(cat version).deb | grep "Depends:.*bash.*" +} + ################################## # Install DEB package ################################## diff --git a/qa/vagrant/src/test/resources/packaging/scripts/40_rpm_package.bats b/qa/vagrant/src/test/resources/packaging/scripts/40_rpm_package.bats index 0555f55cba6..c47f24e6c67 100644 --- a/qa/vagrant/src/test/resources/packaging/scripts/40_rpm_package.bats +++ b/qa/vagrant/src/test/resources/packaging/scripts/40_rpm_package.bats @@ -39,6 +39,10 @@ setup() { export_elasticsearch_paths } +@test "[RPM] package depends on bash" { + rpm -qpR elasticsearch-$(cat version).rpm | grep '/bin/bash' +} + ################################## # Install RPM package ################################## From 5ee5cc25ccaf4c11deb5a8e365df6c6071f126d2 Mon Sep 17 00:00:00 2001 From: Zachary Tong Date: Thu, 12 May 2016 09:34:15 -0400 Subject: [PATCH 3/5] Move AsciiFolding earlier in FingerprintAnalyzer filter chain Rearranges the FingerprintAnalyzer so that AsciiFolding comes earlier in the chain (after lowercasing, before stop removal, for maximum deduping power) Closes #18266 --- .../index/analysis/FingerprintAnalyzer.java | 2 +- .../index/analysis/FingerprintAnalyzerTests.java | 6 +++++- .../analysis/analyzers/fingerprint-analyzer.asciidoc | 11 +++++------ 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/index/analysis/FingerprintAnalyzer.java b/core/src/main/java/org/elasticsearch/index/analysis/FingerprintAnalyzer.java index 66fdbeaeb39..f7bf44256cc 100644 --- a/core/src/main/java/org/elasticsearch/index/analysis/FingerprintAnalyzer.java +++ b/core/src/main/java/org/elasticsearch/index/analysis/FingerprintAnalyzer.java @@ -48,9 +48,9 @@ public final class FingerprintAnalyzer extends Analyzer { final Tokenizer tokenizer = new StandardTokenizer(); TokenStream stream = tokenizer; stream = new LowerCaseFilter(stream); + stream = new ASCIIFoldingFilter(stream, preserveOriginal); stream = new StopFilter(stream, stopWords); stream = new FingerprintFilter(stream, maxOutputSize, separator); - stream = new ASCIIFoldingFilter(stream, preserveOriginal); return new TokenStreamComponents(tokenizer, stream); } } diff --git a/core/src/test/java/org/elasticsearch/index/analysis/FingerprintAnalyzerTests.java b/core/src/test/java/org/elasticsearch/index/analysis/FingerprintAnalyzerTests.java index 0e4ed8f4fb7..8c1d530e448 100644 --- a/core/src/test/java/org/elasticsearch/index/analysis/FingerprintAnalyzerTests.java +++ b/core/src/test/java/org/elasticsearch/index/analysis/FingerprintAnalyzerTests.java @@ -43,12 +43,15 @@ public class FingerprintAnalyzerTests extends ESTokenStreamTestCase { Analyzer a = new FingerprintAnalyzer(CharArraySet.EMPTY_SET, ' ', 255, false); assertAnalyzesTo(a, "gödel escher bach", new String[]{"bach escher godel"}); + + assertAnalyzesTo(a, "gödel godel escher bach", + new String[]{"bach escher godel"}); } public void testPreserveOriginal() throws Exception { Analyzer a = new FingerprintAnalyzer(CharArraySet.EMPTY_SET, ' ', 255, true); assertAnalyzesTo(a, "gödel escher bach", - new String[]{"bach escher godel", "bach escher gödel"}); + new String[]{"bach escher godel gödel"}); } public void testLimit() throws Exception { @@ -65,4 +68,5 @@ public class FingerprintAnalyzerTests extends ESTokenStreamTestCase { assertAnalyzesTo(a, "b c a", new String[]{"a_b_c"}); } + } diff --git a/docs/reference/analysis/analyzers/fingerprint-analyzer.asciidoc b/docs/reference/analysis/analyzers/fingerprint-analyzer.asciidoc index a66495acdbe..b393c883441 100644 --- a/docs/reference/analysis/analyzers/fingerprint-analyzer.asciidoc +++ b/docs/reference/analysis/analyzers/fingerprint-analyzer.asciidoc @@ -17,11 +17,11 @@ It consists of: Tokenizer:: * <> -Token Filters:: -* <> -* <> (disabled by default) -* <> -* <> +Token Filters (in order):: +1. <> +2. <> +3. <> (disabled by default) +4. <> [float] === Example output @@ -68,7 +68,6 @@ The `fingerprint` analyzer accepts the following parameters: A pre-defined stop words list like `_english_` or an array containing a list of stop words. Defaults to `_none_`. - `stopwords_path`:: The path to a file containing stop words. From 94317b1d333e7023b9c3416cbfae3fe08cc86087 Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Thu, 12 May 2016 12:20:06 -0400 Subject: [PATCH 4/5] Add wait_for_health=yellow to reindex snippets This should help the tests pass more consistently. Should. This also removes from `?pretty` from the docs. It isn't a thing with `// CONSOLE`. Relates to https://elasticsearch-ci.elastic.co/job/elastic+elasticsearch+master+multijob-os-compatibility/os=oraclelinux/399/console --- docs/reference/docs/reindex.asciidoc | 16 ++++++++-------- docs/reference/docs/update-by-query.asciidoc | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/reference/docs/reindex.asciidoc b/docs/reference/docs/reindex.asciidoc index 00c5d34304e..49ee8dcd283 100644 --- a/docs/reference/docs/reindex.asciidoc +++ b/docs/reference/docs/reindex.asciidoc @@ -174,7 +174,7 @@ POST _reindex } -------------------------------------------------- // CONSOLE -// TEST[s/^/PUT twitter\nPUT blog\n/] +// TEST[s/^/PUT twitter\nPUT blog\nGET _cluster\/health?wait_for_status=yellow\n/] It's also possible to limit the number of processed documents by setting `size`. This will only copy a single document from `twitter` to @@ -299,7 +299,7 @@ POST _reindex } -------------------------------------------------- // CONSOLE -// TEST[s/^/PUT source\n/] +// TEST[s/^/PUT source\nGET _cluster\/health?wait_for_status=yellow\n/] By default `_reindex` uses scroll batches of 100. You can change the batch size with the `size` field in the `source` element: @@ -319,7 +319,7 @@ POST _reindex } -------------------------------------------------- // CONSOLE -// TEST[s/^/PUT source\n/] +// TEST[s/^/PUT source\nGET _cluster\/health?wait_for_status=yellow\n/] Reindex can also use the <> feature by specifying a `pipeline` like this: @@ -338,7 +338,7 @@ POST _reindex } -------------------------------------------------- // CONSOLE -// TEST[s/^/PUT source\n/] +// TEST[s/^/PUT source\nGET _cluster\/health?wait_for_status=yellow\n/] [float] === URL Parameters @@ -435,7 +435,7 @@ While Reindex is running you can fetch their status using the [source,js] -------------------------------------------------- -GET _tasks/?pretty&detailed=true&actions=*reindex +GET _tasks?detailed=true&actions=*reindex -------------------------------------------------- // CONSOLE @@ -534,7 +534,7 @@ create an index containing documents that look like this: [source,js] -------------------------------------------------- -POST test/test/1?refresh&pretty +POST test/test/1?refresh { "text": "words words", "flag": "foo" @@ -547,7 +547,7 @@ But you don't like the name `flag` and want to replace it with `tag`. [source,js] -------------------------------------------------- -POST _reindex?pretty +POST _reindex { "source": { "index": "test" @@ -567,7 +567,7 @@ Now you can get the new document: [source,js] -------------------------------------------------- -GET test2/test/1?pretty +GET test2/test/1 -------------------------------------------------- // CONSOLE // TEST[continued] diff --git a/docs/reference/docs/update-by-query.asciidoc b/docs/reference/docs/update-by-query.asciidoc index 2de592f59a1..f049e302b34 100644 --- a/docs/reference/docs/update-by-query.asciidoc +++ b/docs/reference/docs/update-by-query.asciidoc @@ -134,7 +134,7 @@ types at once, just like the search API: POST twitter,blog/tweet,post/_update_by_query -------------------------------------------------- // CONSOLE -// TEST[s/^/PUT twitter\nPUT blog\n/] +// TEST[s/^/PUT twitter\nPUT blog\nGET _cluster\/health?wait_for_status=yellow\n/] If you provide `routing` then the routing is copied to the scroll query, limiting the process to the shards that match that routing value: @@ -266,7 +266,7 @@ While Update By Query is running you can fetch their status using the [source,js] -------------------------------------------------- -GET _tasks/?pretty&detailed=true&action=*byquery +GET _tasks?detailed=true&action=*byquery -------------------------------------------------- // CONSOLE From 0830bd4885b8e7c7aca03f7dbbd10dd1ebe2ebfe Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Thu, 12 May 2016 12:47:57 -0400 Subject: [PATCH 5/5] Remove period in min master node check log message As most of our log messages are not sentences and do not end with periods, this commit removes a period from the end of the min master node bootstrap check log message. --- .../main/java/org/elasticsearch/bootstrap/BootstrapCheck.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/org/elasticsearch/bootstrap/BootstrapCheck.java b/core/src/main/java/org/elasticsearch/bootstrap/BootstrapCheck.java index 37a89531184..925940a3903 100644 --- a/core/src/main/java/org/elasticsearch/bootstrap/BootstrapCheck.java +++ b/core/src/main/java/org/elasticsearch/bootstrap/BootstrapCheck.java @@ -335,7 +335,7 @@ final class BootstrapCheck { @Override public String errorMessage() { return "please set [" + ElectMasterService.DISCOVERY_ZEN_MINIMUM_MASTER_NODES_SETTING.getKey() + - "] to a majority of the number of master eligible nodes in your cluster."; + "] to a majority of the number of master eligible nodes in your cluster"; } @Override