From 5c84640126e66de68f6e742ccb1a9d351f638fd4 Mon Sep 17 00:00:00 2001 From: Jim Ferenczi Date: Mon, 27 Feb 2017 18:39:04 +0100 Subject: [PATCH] Upgrade to lucene-6.5.0-snapshot-d00c5ca (#23385) Lucene upgrade --- buildSrc/version.properties | 2 +- ...ers-common-6.5.0-snapshot-d00c5ca.jar.sha1 | 1 + ...ers-common-6.5.0-snapshot-f919485.jar.sha1 | 1 - ...ard-codecs-6.5.0-snapshot-d00c5ca.jar.sha1 | 1 + ...ard-codecs-6.5.0-snapshot-f919485.jar.sha1 | 1 - ...ucene-core-6.5.0-snapshot-d00c5ca.jar.sha1 | 1 + ...ucene-core-6.5.0-snapshot-f919485.jar.sha1 | 1 - ...e-grouping-6.5.0-snapshot-d00c5ca.jar.sha1 | 1 + ...e-grouping-6.5.0-snapshot-f919485.jar.sha1 | 1 - ...ighlighter-6.5.0-snapshot-d00c5ca.jar.sha1 | 1 + ...ighlighter-6.5.0-snapshot-f919485.jar.sha1 | 1 - ...ucene-join-6.5.0-snapshot-d00c5ca.jar.sha1 | 1 + ...ucene-join-6.5.0-snapshot-f919485.jar.sha1 | 1 - ...ene-memory-6.5.0-snapshot-d00c5ca.jar.sha1 | 1 + ...ene-memory-6.5.0-snapshot-f919485.jar.sha1 | 1 - ...ucene-misc-6.5.0-snapshot-d00c5ca.jar.sha1 | 1 + ...ucene-misc-6.5.0-snapshot-f919485.jar.sha1 | 1 - ...ne-queries-6.5.0-snapshot-d00c5ca.jar.sha1 | 1 + ...ne-queries-6.5.0-snapshot-f919485.jar.sha1 | 1 - ...ueryparser-6.5.0-snapshot-d00c5ca.jar.sha1 | 1 + ...ueryparser-6.5.0-snapshot-f919485.jar.sha1 | 1 - ...ne-sandbox-6.5.0-snapshot-d00c5ca.jar.sha1 | 1 + ...ne-sandbox-6.5.0-snapshot-f919485.jar.sha1 | 1 - ...ne-spatial-6.5.0-snapshot-d00c5ca.jar.sha1 | 1 + ...ne-spatial-6.5.0-snapshot-f919485.jar.sha1 | 1 - ...ial-extras-6.5.0-snapshot-d00c5ca.jar.sha1 | 1 + ...ial-extras-6.5.0-snapshot-f919485.jar.sha1 | 1 - ...-spatial3d-6.5.0-snapshot-d00c5ca.jar.sha1 | 1 + ...-spatial3d-6.5.0-snapshot-f919485.jar.sha1 | 1 - ...ne-suggest-6.5.0-snapshot-d00c5ca.jar.sha1 | 1 + ...ne-suggest-6.5.0-snapshot-f919485.jar.sha1 | 1 - .../classic/MapperQueryParser.java | 43 ++++--- .../action/search/SearchPhaseController.java | 6 +- .../PatternReplaceCharFilterFactory.java | 13 +- .../index/search/MatchQuery.java | 49 ++++++-- .../metrics/tophits/InternalTopHits.java | 4 +- .../search/profile/query/ProfileScorer.java | 2 +- .../completion/CompletionSuggester.java | 4 +- .../elasticsearch/bootstrap/security.policy | 4 +- .../bootstrap/test-framework.policy | 2 +- .../query/QueryStringQueryBuilderTests.java | 114 ++++++++---------- .../index/query/SimpleQueryParserTests.java | 34 +++--- .../search/ESToParentBlockJoinQueryTests.java | 14 +-- ...xpressions-6.5.0-snapshot-d00c5ca.jar.sha1 | 1 + ...xpressions-6.5.0-snapshot-f919485.jar.sha1 | 1 - ...lyzers-icu-6.5.0-snapshot-d00c5ca.jar.sha1 | 1 + ...lyzers-icu-6.5.0-snapshot-f919485.jar.sha1 | 1 - ...s-kuromoji-6.5.0-snapshot-d00c5ca.jar.sha1 | 1 + ...s-kuromoji-6.5.0-snapshot-f919485.jar.sha1 | 1 - ...s-phonetic-6.5.0-snapshot-d00c5ca.jar.sha1 | 1 + ...s-phonetic-6.5.0-snapshot-f919485.jar.sha1 | 1 - ...rs-smartcn-6.5.0-snapshot-d00c5ca.jar.sha1 | 1 + ...rs-smartcn-6.5.0-snapshot-f919485.jar.sha1 | 1 - ...rs-stempel-6.5.0-snapshot-d00c5ca.jar.sha1 | 1 + ...rs-stempel-6.5.0-snapshot-f919485.jar.sha1 | 1 - ...morfologik-6.5.0-snapshot-d00c5ca.jar.sha1 | 1 + ...morfologik-6.5.0-snapshot-f919485.jar.sha1 | 1 - .../AnalysisFactoryTestCase.java | 4 + 58 files changed, 184 insertions(+), 155 deletions(-) create mode 100644 core/licenses/lucene-analyzers-common-6.5.0-snapshot-d00c5ca.jar.sha1 delete mode 100644 core/licenses/lucene-analyzers-common-6.5.0-snapshot-f919485.jar.sha1 create mode 100644 core/licenses/lucene-backward-codecs-6.5.0-snapshot-d00c5ca.jar.sha1 delete mode 100644 core/licenses/lucene-backward-codecs-6.5.0-snapshot-f919485.jar.sha1 create mode 100644 core/licenses/lucene-core-6.5.0-snapshot-d00c5ca.jar.sha1 delete mode 100644 core/licenses/lucene-core-6.5.0-snapshot-f919485.jar.sha1 create mode 100644 core/licenses/lucene-grouping-6.5.0-snapshot-d00c5ca.jar.sha1 delete mode 100644 core/licenses/lucene-grouping-6.5.0-snapshot-f919485.jar.sha1 create mode 100644 core/licenses/lucene-highlighter-6.5.0-snapshot-d00c5ca.jar.sha1 delete mode 100644 core/licenses/lucene-highlighter-6.5.0-snapshot-f919485.jar.sha1 create mode 100644 core/licenses/lucene-join-6.5.0-snapshot-d00c5ca.jar.sha1 delete mode 100644 core/licenses/lucene-join-6.5.0-snapshot-f919485.jar.sha1 create mode 100644 core/licenses/lucene-memory-6.5.0-snapshot-d00c5ca.jar.sha1 delete mode 100644 core/licenses/lucene-memory-6.5.0-snapshot-f919485.jar.sha1 create mode 100644 core/licenses/lucene-misc-6.5.0-snapshot-d00c5ca.jar.sha1 delete mode 100644 core/licenses/lucene-misc-6.5.0-snapshot-f919485.jar.sha1 create mode 100644 core/licenses/lucene-queries-6.5.0-snapshot-d00c5ca.jar.sha1 delete mode 100644 core/licenses/lucene-queries-6.5.0-snapshot-f919485.jar.sha1 create mode 100644 core/licenses/lucene-queryparser-6.5.0-snapshot-d00c5ca.jar.sha1 delete mode 100644 core/licenses/lucene-queryparser-6.5.0-snapshot-f919485.jar.sha1 create mode 100644 core/licenses/lucene-sandbox-6.5.0-snapshot-d00c5ca.jar.sha1 delete mode 100644 core/licenses/lucene-sandbox-6.5.0-snapshot-f919485.jar.sha1 create mode 100644 core/licenses/lucene-spatial-6.5.0-snapshot-d00c5ca.jar.sha1 delete mode 100644 core/licenses/lucene-spatial-6.5.0-snapshot-f919485.jar.sha1 create mode 100644 core/licenses/lucene-spatial-extras-6.5.0-snapshot-d00c5ca.jar.sha1 delete mode 100644 core/licenses/lucene-spatial-extras-6.5.0-snapshot-f919485.jar.sha1 create mode 100644 core/licenses/lucene-spatial3d-6.5.0-snapshot-d00c5ca.jar.sha1 delete mode 100644 core/licenses/lucene-spatial3d-6.5.0-snapshot-f919485.jar.sha1 create mode 100644 core/licenses/lucene-suggest-6.5.0-snapshot-d00c5ca.jar.sha1 delete mode 100644 core/licenses/lucene-suggest-6.5.0-snapshot-f919485.jar.sha1 create mode 100644 modules/lang-expression/licenses/lucene-expressions-6.5.0-snapshot-d00c5ca.jar.sha1 delete mode 100644 modules/lang-expression/licenses/lucene-expressions-6.5.0-snapshot-f919485.jar.sha1 create mode 100644 plugins/analysis-icu/licenses/lucene-analyzers-icu-6.5.0-snapshot-d00c5ca.jar.sha1 delete mode 100644 plugins/analysis-icu/licenses/lucene-analyzers-icu-6.5.0-snapshot-f919485.jar.sha1 create mode 100644 plugins/analysis-kuromoji/licenses/lucene-analyzers-kuromoji-6.5.0-snapshot-d00c5ca.jar.sha1 delete mode 100644 plugins/analysis-kuromoji/licenses/lucene-analyzers-kuromoji-6.5.0-snapshot-f919485.jar.sha1 create mode 100644 plugins/analysis-phonetic/licenses/lucene-analyzers-phonetic-6.5.0-snapshot-d00c5ca.jar.sha1 delete mode 100644 plugins/analysis-phonetic/licenses/lucene-analyzers-phonetic-6.5.0-snapshot-f919485.jar.sha1 create mode 100644 plugins/analysis-smartcn/licenses/lucene-analyzers-smartcn-6.5.0-snapshot-d00c5ca.jar.sha1 delete mode 100644 plugins/analysis-smartcn/licenses/lucene-analyzers-smartcn-6.5.0-snapshot-f919485.jar.sha1 create mode 100644 plugins/analysis-stempel/licenses/lucene-analyzers-stempel-6.5.0-snapshot-d00c5ca.jar.sha1 delete mode 100644 plugins/analysis-stempel/licenses/lucene-analyzers-stempel-6.5.0-snapshot-f919485.jar.sha1 create mode 100644 plugins/analysis-ukrainian/licenses/lucene-analyzers-morfologik-6.5.0-snapshot-d00c5ca.jar.sha1 delete mode 100644 plugins/analysis-ukrainian/licenses/lucene-analyzers-morfologik-6.5.0-snapshot-f919485.jar.sha1 diff --git a/buildSrc/version.properties b/buildSrc/version.properties index 1e996b3900d..1a4c62d2a8a 100644 --- a/buildSrc/version.properties +++ b/buildSrc/version.properties @@ -1,6 +1,6 @@ # When updating elasticsearch, please update 'rest' version in core/src/main/resources/org/elasticsearch/bootstrap/test-framework.policy elasticsearch = 6.0.0-alpha1 -lucene = 6.5.0-snapshot-f919485 +lucene = 6.5.0-snapshot-d00c5ca # optional dependencies spatial4j = 0.6 diff --git a/core/licenses/lucene-analyzers-common-6.5.0-snapshot-d00c5ca.jar.sha1 b/core/licenses/lucene-analyzers-common-6.5.0-snapshot-d00c5ca.jar.sha1 new file mode 100644 index 00000000000..320a300a765 --- /dev/null +++ b/core/licenses/lucene-analyzers-common-6.5.0-snapshot-d00c5ca.jar.sha1 @@ -0,0 +1 @@ +9ad2a7bd252cbdb76ac121287e670d75f4db2cd3 \ No newline at end of file diff --git a/core/licenses/lucene-analyzers-common-6.5.0-snapshot-f919485.jar.sha1 b/core/licenses/lucene-analyzers-common-6.5.0-snapshot-f919485.jar.sha1 deleted file mode 100644 index e53ca6efbac..00000000000 --- a/core/licenses/lucene-analyzers-common-6.5.0-snapshot-f919485.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -886c1da9adc3347f61ab95ecbf4dbeeaa0e7acb2 \ No newline at end of file diff --git a/core/licenses/lucene-backward-codecs-6.5.0-snapshot-d00c5ca.jar.sha1 b/core/licenses/lucene-backward-codecs-6.5.0-snapshot-d00c5ca.jar.sha1 new file mode 100644 index 00000000000..c313a86e271 --- /dev/null +++ b/core/licenses/lucene-backward-codecs-6.5.0-snapshot-d00c5ca.jar.sha1 @@ -0,0 +1 @@ +c6a940eff8a87df40262b752ed7b135e448b7873 \ No newline at end of file diff --git a/core/licenses/lucene-backward-codecs-6.5.0-snapshot-f919485.jar.sha1 b/core/licenses/lucene-backward-codecs-6.5.0-snapshot-f919485.jar.sha1 deleted file mode 100644 index 6025e4b484c..00000000000 --- a/core/licenses/lucene-backward-codecs-6.5.0-snapshot-f919485.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -df9e94f63ad7d9188f14820c435ea1dc3c28d87a \ No newline at end of file diff --git a/core/licenses/lucene-core-6.5.0-snapshot-d00c5ca.jar.sha1 b/core/licenses/lucene-core-6.5.0-snapshot-d00c5ca.jar.sha1 new file mode 100644 index 00000000000..8e2ce3f31ac --- /dev/null +++ b/core/licenses/lucene-core-6.5.0-snapshot-d00c5ca.jar.sha1 @@ -0,0 +1 @@ +6ef5ad88141760c00ea041da1535f3ffc364d67d \ No newline at end of file diff --git a/core/licenses/lucene-core-6.5.0-snapshot-f919485.jar.sha1 b/core/licenses/lucene-core-6.5.0-snapshot-f919485.jar.sha1 deleted file mode 100644 index ada60f05960..00000000000 --- a/core/licenses/lucene-core-6.5.0-snapshot-f919485.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -3539f8dc9c3ed8ebe90afcb3daa2e9afcf5108d1 \ No newline at end of file diff --git a/core/licenses/lucene-grouping-6.5.0-snapshot-d00c5ca.jar.sha1 b/core/licenses/lucene-grouping-6.5.0-snapshot-d00c5ca.jar.sha1 new file mode 100644 index 00000000000..b5e793e4d39 --- /dev/null +++ b/core/licenses/lucene-grouping-6.5.0-snapshot-d00c5ca.jar.sha1 @@ -0,0 +1 @@ +f15775571fb5762dfc92e00c3909cb8db8ff1d53 \ No newline at end of file diff --git a/core/licenses/lucene-grouping-6.5.0-snapshot-f919485.jar.sha1 b/core/licenses/lucene-grouping-6.5.0-snapshot-f919485.jar.sha1 deleted file mode 100644 index e117e6d96f9..00000000000 --- a/core/licenses/lucene-grouping-6.5.0-snapshot-f919485.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -da76338e4f299963da9d7ab33dae7586dfc902c2 \ No newline at end of file diff --git a/core/licenses/lucene-highlighter-6.5.0-snapshot-d00c5ca.jar.sha1 b/core/licenses/lucene-highlighter-6.5.0-snapshot-d00c5ca.jar.sha1 new file mode 100644 index 00000000000..c90084cc1cb --- /dev/null +++ b/core/licenses/lucene-highlighter-6.5.0-snapshot-d00c5ca.jar.sha1 @@ -0,0 +1 @@ +051d793aa64257beead4ccc7432eb5df81d17f23 \ No newline at end of file diff --git a/core/licenses/lucene-highlighter-6.5.0-snapshot-f919485.jar.sha1 b/core/licenses/lucene-highlighter-6.5.0-snapshot-f919485.jar.sha1 deleted file mode 100644 index e23602806b3..00000000000 --- a/core/licenses/lucene-highlighter-6.5.0-snapshot-f919485.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -f6318d120236c7ac03fca6bf98825b4cb4347fc8 \ No newline at end of file diff --git a/core/licenses/lucene-join-6.5.0-snapshot-d00c5ca.jar.sha1 b/core/licenses/lucene-join-6.5.0-snapshot-d00c5ca.jar.sha1 new file mode 100644 index 00000000000..b6dfc376fbb --- /dev/null +++ b/core/licenses/lucene-join-6.5.0-snapshot-d00c5ca.jar.sha1 @@ -0,0 +1 @@ +5bc4cba55670c14ea812ff5de65edad4c312fdf6 \ No newline at end of file diff --git a/core/licenses/lucene-join-6.5.0-snapshot-f919485.jar.sha1 b/core/licenses/lucene-join-6.5.0-snapshot-f919485.jar.sha1 deleted file mode 100644 index a8408f6acfe..00000000000 --- a/core/licenses/lucene-join-6.5.0-snapshot-f919485.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -68f045ff272e10c307fe25a1867c2948b614b57c \ No newline at end of file diff --git a/core/licenses/lucene-memory-6.5.0-snapshot-d00c5ca.jar.sha1 b/core/licenses/lucene-memory-6.5.0-snapshot-d00c5ca.jar.sha1 new file mode 100644 index 00000000000..cfc1d044ca7 --- /dev/null +++ b/core/licenses/lucene-memory-6.5.0-snapshot-d00c5ca.jar.sha1 @@ -0,0 +1 @@ +68cf08bcd8414a57493debf3a6a509d78a9abb56 \ No newline at end of file diff --git a/core/licenses/lucene-memory-6.5.0-snapshot-f919485.jar.sha1 b/core/licenses/lucene-memory-6.5.0-snapshot-f919485.jar.sha1 deleted file mode 100644 index acfe1ea6ca8..00000000000 --- a/core/licenses/lucene-memory-6.5.0-snapshot-f919485.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -b58a7a15267614a9a14f7cf6257454e0c24b146d \ No newline at end of file diff --git a/core/licenses/lucene-misc-6.5.0-snapshot-d00c5ca.jar.sha1 b/core/licenses/lucene-misc-6.5.0-snapshot-d00c5ca.jar.sha1 new file mode 100644 index 00000000000..938b26b5a4d --- /dev/null +++ b/core/licenses/lucene-misc-6.5.0-snapshot-d00c5ca.jar.sha1 @@ -0,0 +1 @@ +f5d90756dbeda1218d723b7bea0799c88d621adb \ No newline at end of file diff --git a/core/licenses/lucene-misc-6.5.0-snapshot-f919485.jar.sha1 b/core/licenses/lucene-misc-6.5.0-snapshot-f919485.jar.sha1 deleted file mode 100644 index 3175fbad810..00000000000 --- a/core/licenses/lucene-misc-6.5.0-snapshot-f919485.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -d5f00fcd00fee6906b563d201bc00bdea7a92baa \ No newline at end of file diff --git a/core/licenses/lucene-queries-6.5.0-snapshot-d00c5ca.jar.sha1 b/core/licenses/lucene-queries-6.5.0-snapshot-d00c5ca.jar.sha1 new file mode 100644 index 00000000000..31dcaaaaabc --- /dev/null +++ b/core/licenses/lucene-queries-6.5.0-snapshot-d00c5ca.jar.sha1 @@ -0,0 +1 @@ +9298e7d1ed96e7beb63d7ccdce1a4502eb0fe484 \ No newline at end of file diff --git a/core/licenses/lucene-queries-6.5.0-snapshot-f919485.jar.sha1 b/core/licenses/lucene-queries-6.5.0-snapshot-f919485.jar.sha1 deleted file mode 100644 index 82c3080bd85..00000000000 --- a/core/licenses/lucene-queries-6.5.0-snapshot-f919485.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -2664901a494d87e9f4cef65be14cca918da7c4f5 \ No newline at end of file diff --git a/core/licenses/lucene-queryparser-6.5.0-snapshot-d00c5ca.jar.sha1 b/core/licenses/lucene-queryparser-6.5.0-snapshot-d00c5ca.jar.sha1 new file mode 100644 index 00000000000..346d897a4cf --- /dev/null +++ b/core/licenses/lucene-queryparser-6.5.0-snapshot-d00c5ca.jar.sha1 @@ -0,0 +1 @@ +918de18963607af69dff38e4773c0bde89c73ae3 \ No newline at end of file diff --git a/core/licenses/lucene-queryparser-6.5.0-snapshot-f919485.jar.sha1 b/core/licenses/lucene-queryparser-6.5.0-snapshot-f919485.jar.sha1 deleted file mode 100644 index c95d59d535e..00000000000 --- a/core/licenses/lucene-queryparser-6.5.0-snapshot-f919485.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -476a79293f9a15ea1ee5f93684587205d03480d1 \ No newline at end of file diff --git a/core/licenses/lucene-sandbox-6.5.0-snapshot-d00c5ca.jar.sha1 b/core/licenses/lucene-sandbox-6.5.0-snapshot-d00c5ca.jar.sha1 new file mode 100644 index 00000000000..d7e3a49e9ee --- /dev/null +++ b/core/licenses/lucene-sandbox-6.5.0-snapshot-d00c5ca.jar.sha1 @@ -0,0 +1 @@ +a311a7d9f3e9a8fbf3a367a4e2731f9d4579732b \ No newline at end of file diff --git a/core/licenses/lucene-sandbox-6.5.0-snapshot-f919485.jar.sha1 b/core/licenses/lucene-sandbox-6.5.0-snapshot-f919485.jar.sha1 deleted file mode 100644 index b5065a8bee5..00000000000 --- a/core/licenses/lucene-sandbox-6.5.0-snapshot-f919485.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -f4dd70223178cca067b0cade4e58c4d82bec87d6 \ No newline at end of file diff --git a/core/licenses/lucene-spatial-6.5.0-snapshot-d00c5ca.jar.sha1 b/core/licenses/lucene-spatial-6.5.0-snapshot-d00c5ca.jar.sha1 new file mode 100644 index 00000000000..21062261226 --- /dev/null +++ b/core/licenses/lucene-spatial-6.5.0-snapshot-d00c5ca.jar.sha1 @@ -0,0 +1 @@ +693bc4cb0e2e4465e0173c67ed0818071c4b460b \ No newline at end of file diff --git a/core/licenses/lucene-spatial-6.5.0-snapshot-f919485.jar.sha1 b/core/licenses/lucene-spatial-6.5.0-snapshot-f919485.jar.sha1 deleted file mode 100644 index 3e255fc8a86..00000000000 --- a/core/licenses/lucene-spatial-6.5.0-snapshot-f919485.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -72c4ec5d811480164db556b54c7a76bd3ea16bd6 \ No newline at end of file diff --git a/core/licenses/lucene-spatial-extras-6.5.0-snapshot-d00c5ca.jar.sha1 b/core/licenses/lucene-spatial-extras-6.5.0-snapshot-d00c5ca.jar.sha1 new file mode 100644 index 00000000000..8eae8b0675d --- /dev/null +++ b/core/licenses/lucene-spatial-extras-6.5.0-snapshot-d00c5ca.jar.sha1 @@ -0,0 +1 @@ +0326f31e63c76d476c23488c7354265cf915350f \ No newline at end of file diff --git a/core/licenses/lucene-spatial-extras-6.5.0-snapshot-f919485.jar.sha1 b/core/licenses/lucene-spatial-extras-6.5.0-snapshot-f919485.jar.sha1 deleted file mode 100644 index f27eb0c2446..00000000000 --- a/core/licenses/lucene-spatial-extras-6.5.0-snapshot-f919485.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -f7af3755fdd09df7c258c655aff03ddef9536a04 \ No newline at end of file diff --git a/core/licenses/lucene-spatial3d-6.5.0-snapshot-d00c5ca.jar.sha1 b/core/licenses/lucene-spatial3d-6.5.0-snapshot-d00c5ca.jar.sha1 new file mode 100644 index 00000000000..8ce95f97f11 --- /dev/null +++ b/core/licenses/lucene-spatial3d-6.5.0-snapshot-d00c5ca.jar.sha1 @@ -0,0 +1 @@ +69a3a86e9d045f872408793ea411d49e0c577268 \ No newline at end of file diff --git a/core/licenses/lucene-spatial3d-6.5.0-snapshot-f919485.jar.sha1 b/core/licenses/lucene-spatial3d-6.5.0-snapshot-f919485.jar.sha1 deleted file mode 100644 index 12990b49d29..00000000000 --- a/core/licenses/lucene-spatial3d-6.5.0-snapshot-f919485.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -2bf820109203b990e93a05dade8dcebec6aeb71a \ No newline at end of file diff --git a/core/licenses/lucene-suggest-6.5.0-snapshot-d00c5ca.jar.sha1 b/core/licenses/lucene-suggest-6.5.0-snapshot-d00c5ca.jar.sha1 new file mode 100644 index 00000000000..2941229bbe0 --- /dev/null +++ b/core/licenses/lucene-suggest-6.5.0-snapshot-d00c5ca.jar.sha1 @@ -0,0 +1 @@ +fabc05ca175150171cf60370877276b933716bcd \ No newline at end of file diff --git a/core/licenses/lucene-suggest-6.5.0-snapshot-f919485.jar.sha1 b/core/licenses/lucene-suggest-6.5.0-snapshot-f919485.jar.sha1 deleted file mode 100644 index a99ede54a51..00000000000 --- a/core/licenses/lucene-suggest-6.5.0-snapshot-f919485.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -fc1f32923ee68761ee05051f4ef6f4a4ab3acdec \ No newline at end of file diff --git a/core/src/main/java/org/apache/lucene/queryparser/classic/MapperQueryParser.java b/core/src/main/java/org/apache/lucene/queryparser/classic/MapperQueryParser.java index c1998c65000..2b2576b50b6 100644 --- a/core/src/main/java/org/apache/lucene/queryparser/classic/MapperQueryParser.java +++ b/core/src/main/java/org/apache/lucene/queryparser/classic/MapperQueryParser.java @@ -19,9 +19,6 @@ package org.apache.lucene.queryparser.classic; -import static java.util.Collections.unmodifiableMap; -import static org.elasticsearch.common.lucene.search.Queries.fixNegativeQueryIfNeeded; - import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; @@ -33,12 +30,14 @@ import org.apache.lucene.search.BooleanQuery; import org.apache.lucene.search.BoostQuery; import org.apache.lucene.search.DisjunctionMaxQuery; import org.apache.lucene.search.FuzzyQuery; -import org.apache.lucene.search.GraphQuery; import org.apache.lucene.search.MatchNoDocsQuery; import org.apache.lucene.search.MultiPhraseQuery; import org.apache.lucene.search.PhraseQuery; import org.apache.lucene.search.Query; import org.apache.lucene.search.SynonymQuery; +import org.apache.lucene.search.spans.SpanNearQuery; +import org.apache.lucene.search.spans.SpanOrQuery; +import org.apache.lucene.search.spans.SpanQuery; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOUtils; import org.apache.lucene.util.automaton.RegExp; @@ -59,6 +58,9 @@ import java.util.List; import java.util.Map; import java.util.Objects; +import static java.util.Collections.unmodifiableMap; +import static org.elasticsearch.common.lucene.search.Queries.fixNegativeQueryIfNeeded; + /** * A query parser that uses the {@link MapperService} in order to build smarter * queries based on the mapping information. @@ -747,26 +749,29 @@ public class MapperQueryParser extends AnalyzingQueryParser { MultiPhraseQuery.Builder builder = new MultiPhraseQuery.Builder((MultiPhraseQuery) q); builder.setSlop(slop); return builder.build(); - } else if (q instanceof GraphQuery && ((GraphQuery) q).hasPhrase()) { - // we have a graph query that has at least one phrase sub-query - // re-build and set slop on all phrase queries - List oldQueries = ((GraphQuery) q).getQueries(); - Query[] queries = new Query[oldQueries.size()]; - for (int i = 0; i < queries.length; i++) { - Query oldQuery = oldQueries.get(i); - if (oldQuery instanceof PhraseQuery) { - queries[i] = addSlopToPhrase((PhraseQuery) oldQuery, slop); - } else { - queries[i] = oldQuery; - } - } - - return new GraphQuery(queries); + } else if (q instanceof SpanQuery) { + return addSlopToSpan((SpanQuery) q, slop); } else { return q; } } + private Query addSlopToSpan(SpanQuery query, int slop) { + if (query instanceof SpanNearQuery) { + return new SpanNearQuery(((SpanNearQuery) query).getClauses(), slop, + ((SpanNearQuery) query).isInOrder()); + } else if (query instanceof SpanOrQuery) { + SpanQuery[] clauses = new SpanQuery[((SpanOrQuery) query).getClauses().length]; + int pos = 0; + for (SpanQuery clause : ((SpanOrQuery) query).getClauses()) { + clauses[pos++] = (SpanQuery) addSlopToSpan(clause, slop); + } + return new SpanOrQuery(clauses); + } else { + return query; + } + } + /** * Rebuild a phrase query with a slop value */ diff --git a/core/src/main/java/org/elasticsearch/action/search/SearchPhaseController.java b/core/src/main/java/org/elasticsearch/action/search/SearchPhaseController.java index 068a005204d..cec44d9e9e5 100644 --- a/core/src/main/java/org/elasticsearch/action/search/SearchPhaseController.java +++ b/core/src/main/java/org/elasticsearch/action/search/SearchPhaseController.java @@ -62,11 +62,9 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; -import java.util.Comparator; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.function.Supplier; import java.util.stream.Collectors; import java.util.stream.StreamSupport; @@ -243,11 +241,11 @@ public class SearchPhaseController extends AbstractComponent { final Sort sort = new Sort(firstTopDocs.fields); final TopFieldDocs[] shardTopDocs = new TopFieldDocs[resultsArr.length()]; fillTopDocs(shardTopDocs, results, new TopFieldDocs(0, new FieldDoc[0], sort.getSort(), Float.NaN)); - mergedTopDocs = TopDocs.merge(sort, from, topN, shardTopDocs); + mergedTopDocs = TopDocs.merge(sort, from, topN, shardTopDocs, true); } else { final TopDocs[] shardTopDocs = new TopDocs[resultsArr.length()]; fillTopDocs(shardTopDocs, results, Lucene.EMPTY_TOP_DOCS); - mergedTopDocs = TopDocs.merge(from, topN, shardTopDocs); + mergedTopDocs = TopDocs.merge(from, topN, shardTopDocs, true); } ScoreDoc[] scoreDocs = mergedTopDocs.scoreDocs; diff --git a/core/src/main/java/org/elasticsearch/index/analysis/PatternReplaceCharFilterFactory.java b/core/src/main/java/org/elasticsearch/index/analysis/PatternReplaceCharFilterFactory.java index db428db153d..2562f20373b 100644 --- a/core/src/main/java/org/elasticsearch/index/analysis/PatternReplaceCharFilterFactory.java +++ b/core/src/main/java/org/elasticsearch/index/analysis/PatternReplaceCharFilterFactory.java @@ -18,6 +18,9 @@ */ package org.elasticsearch.index.analysis; +import java.io.Reader; +import java.util.regex.Pattern; + import org.apache.lucene.analysis.pattern.PatternReplaceCharFilter; import org.elasticsearch.common.Strings; import org.elasticsearch.common.regex.Regex; @@ -25,10 +28,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.env.Environment; import org.elasticsearch.index.IndexSettings; -import java.io.Reader; -import java.util.regex.Pattern; - -public class PatternReplaceCharFilterFactory extends AbstractCharFilterFactory { +public class PatternReplaceCharFilterFactory extends AbstractCharFilterFactory implements MultiTermAwareComponent { private final Pattern pattern; private final String replacement; @@ -56,4 +56,9 @@ public class PatternReplaceCharFilterFactory extends AbstractCharFilterFactory { public Reader create(Reader tokenStream) { return new PatternReplaceCharFilter(pattern, replacement, tokenStream); } + + @Override + public Object getMultiTermComponent() { + return this; + } } diff --git a/core/src/main/java/org/elasticsearch/index/search/MatchQuery.java b/core/src/main/java/org/elasticsearch/index/search/MatchQuery.java index 6374e15492d..21d084d5d2f 100644 --- a/core/src/main/java/org/elasticsearch/index/search/MatchQuery.java +++ b/core/src/main/java/org/elasticsearch/index/search/MatchQuery.java @@ -27,13 +27,18 @@ import org.apache.lucene.search.BooleanClause.Occur; import org.apache.lucene.search.BooleanQuery; import org.apache.lucene.search.BoostQuery; import org.apache.lucene.search.FuzzyQuery; -import org.apache.lucene.search.GraphQuery; import org.apache.lucene.search.MultiPhraseQuery; import org.apache.lucene.search.MultiTermQuery; import org.apache.lucene.search.PhraseQuery; +import org.apache.lucene.search.PrefixQuery; import org.apache.lucene.search.Query; import org.apache.lucene.search.SynonymQuery; import org.apache.lucene.search.TermQuery; +import org.apache.lucene.search.spans.SpanMultiTermQueryWrapper; +import org.apache.lucene.search.spans.SpanNearQuery; +import org.apache.lucene.search.spans.SpanOrQuery; +import org.apache.lucene.search.spans.SpanQuery; +import org.apache.lucene.search.spans.SpanTermQuery; import org.apache.lucene.util.QueryBuilder; import org.elasticsearch.ElasticsearchException; import org.elasticsearch.common.Nullable; @@ -49,7 +54,6 @@ import org.elasticsearch.index.query.QueryShardContext; import org.elasticsearch.index.query.support.QueryParsers; import java.io.IOException; -import java.util.List; public class MatchQuery { @@ -318,17 +322,6 @@ public class MatchQuery { public Query createPhrasePrefixQuery(String field, String queryText, int phraseSlop, int maxExpansions) { final Query query = createFieldQuery(getAnalyzer(), Occur.MUST, field, queryText, true, phraseSlop); - if (query instanceof GraphQuery) { - // we have a graph query, convert inner queries to multi phrase prefix queries - List oldQueries = ((GraphQuery) query).getQueries(); - Query[] queries = new Query[oldQueries.size()]; - for (int i = 0; i < queries.length; i++) { - queries[i] = toMultiPhrasePrefix(oldQueries.get(i), phraseSlop, maxExpansions); - } - - return new GraphQuery(queries); - } - return toMultiPhrasePrefix(query, phraseSlop, maxExpansions); } @@ -340,6 +333,9 @@ public class MatchQuery { boost *= bq.getBoost(); innerQuery = bq.getQuery(); } + if (query instanceof SpanQuery) { + return toSpanQueryPrefix((SpanQuery) query, boost); + } final MultiPhrasePrefixQuery prefixQuery = new MultiPhrasePrefixQuery(); prefixQuery.setMaxExpansions(maxExpansions); prefixQuery.setSlop(phraseSlop); @@ -369,6 +365,33 @@ public class MatchQuery { return query; } + private Query toSpanQueryPrefix(SpanQuery query, float boost) { + if (query instanceof SpanTermQuery) { + SpanMultiTermQueryWrapper ret = + new SpanMultiTermQueryWrapper<>(new PrefixQuery(((SpanTermQuery) query).getTerm())); + return boost == 1 ? ret : new BoostQuery(ret, boost); + } else if (query instanceof SpanNearQuery) { + SpanNearQuery spanNearQuery = (SpanNearQuery) query; + SpanQuery[] clauses = spanNearQuery.getClauses(); + if (clauses[clauses.length-1] instanceof SpanTermQuery) { + clauses[clauses.length-1] = new SpanMultiTermQueryWrapper<>( + new PrefixQuery(((SpanTermQuery) clauses[clauses.length-1]).getTerm()) + ); + } + SpanNearQuery newQuery = new SpanNearQuery(clauses, spanNearQuery.getSlop(), spanNearQuery.isInOrder()); + return boost == 1 ? newQuery : new BoostQuery(newQuery, boost); + } else if (query instanceof SpanOrQuery) { + SpanOrQuery orQuery = (SpanOrQuery) query; + SpanQuery[] clauses = new SpanQuery[orQuery.getClauses().length]; + for (int i = 0; i < clauses.length; i++) { + clauses[i] = (SpanQuery) toSpanQueryPrefix(orQuery.getClauses()[i], 1); + } + return boost == 1 ? new SpanOrQuery(clauses) : new BoostQuery(new SpanOrQuery(clauses), boost); + } else { + return query; + } + } + public Query createCommonTermsQuery(String field, String queryText, Occur highFreqOccur, Occur lowFreqOccur, float maxTermFrequency, MappedFieldType fieldType) { Query booleanQuery = createBooleanQuery(field, queryText, lowFreqOccur); diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/metrics/tophits/InternalTopHits.java b/core/src/main/java/org/elasticsearch/search/aggregations/metrics/tophits/InternalTopHits.java index 1b32e6e9dee..d1986f2dd25 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/metrics/tophits/InternalTopHits.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/metrics/tophits/InternalTopHits.java @@ -119,7 +119,7 @@ public class InternalTopHits extends InternalAggregation implements TopHits { shardDocs[i] = topHitsAgg.topDocs; shardHits[i] = topHitsAgg.searchHits; } - reducedTopDocs = TopDocs.merge(sort, from, size, (TopFieldDocs[]) shardDocs); + reducedTopDocs = TopDocs.merge(sort, from, size, (TopFieldDocs[]) shardDocs, true); } else { shardDocs = new TopDocs[aggregations.size()]; for (int i = 0; i < shardDocs.length; i++) { @@ -127,7 +127,7 @@ public class InternalTopHits extends InternalAggregation implements TopHits { shardDocs[i] = topHitsAgg.topDocs; shardHits[i] = topHitsAgg.searchHits; } - reducedTopDocs = TopDocs.merge(from, size, shardDocs); + reducedTopDocs = TopDocs.merge(from, size, shardDocs, true); } final int[] tracker = new int[shardHits.length]; diff --git a/core/src/main/java/org/elasticsearch/search/profile/query/ProfileScorer.java b/core/src/main/java/org/elasticsearch/search/profile/query/ProfileScorer.java index 51d0b14fc96..fa76608eb89 100644 --- a/core/src/main/java/org/elasticsearch/search/profile/query/ProfileScorer.java +++ b/core/src/main/java/org/elasticsearch/search/profile/query/ProfileScorer.java @@ -70,7 +70,7 @@ final class ProfileScorer extends Scorer { } @Override - public Collection getChildren() { + public Collection getChildren() throws IOException { return scorer.getChildren(); } diff --git a/core/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggester.java b/core/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggester.java index b048977741f..abc8d209cd3 100644 --- a/core/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggester.java +++ b/core/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggester.java @@ -184,8 +184,10 @@ public class CompletionSuggester extends Suggester private final SuggestDocPriorityQueue pq; private final Map scoreDocMap; + // TODO: expose dup removal + TopDocumentsCollector(int num) { - super(1); // TODO hack, we don't use the underlying pq, so we allocate a size of 1 + super(1, false); // TODO hack, we don't use the underlying pq, so we allocate a size of 1 this.num = num; this.scoreDocMap = new LinkedHashMap<>(num); this.pq = new SuggestDocPriorityQueue(num); diff --git a/core/src/main/resources/org/elasticsearch/bootstrap/security.policy b/core/src/main/resources/org/elasticsearch/bootstrap/security.policy index 4614d627e07..4b393c0d6e7 100644 --- a/core/src/main/resources/org/elasticsearch/bootstrap/security.policy +++ b/core/src/main/resources/org/elasticsearch/bootstrap/security.policy @@ -31,7 +31,7 @@ grant codeBase "${codebase.securesm-1.1.jar}" { //// Very special jar permissions: //// These are dangerous permissions that we don't want to grant to everything. -grant codeBase "${codebase.lucene-core-6.5.0-snapshot-f919485.jar}" { +grant codeBase "${codebase.lucene-core-6.5.0-snapshot-d00c5ca.jar}" { // needed to allow MMapDirectory's "unmap hack" (die unmap hack, die) // java 8 package permission java.lang.RuntimePermission "accessClassInPackage.sun.misc"; @@ -42,7 +42,7 @@ grant codeBase "${codebase.lucene-core-6.5.0-snapshot-f919485.jar}" { permission java.lang.RuntimePermission "accessDeclaredMembers"; }; -grant codeBase "${codebase.lucene-misc-6.5.0-snapshot-f919485.jar}" { +grant codeBase "${codebase.lucene-misc-6.5.0-snapshot-d00c5ca.jar}" { // needed to allow shard shrinking to use hard-links if possible via lucenes HardlinkCopyDirectoryWrapper permission java.nio.file.LinkPermission "hard"; }; diff --git a/core/src/main/resources/org/elasticsearch/bootstrap/test-framework.policy b/core/src/main/resources/org/elasticsearch/bootstrap/test-framework.policy index 82061d17e36..f7654f2dfff 100644 --- a/core/src/main/resources/org/elasticsearch/bootstrap/test-framework.policy +++ b/core/src/main/resources/org/elasticsearch/bootstrap/test-framework.policy @@ -33,7 +33,7 @@ grant codeBase "${codebase.securemock-1.2.jar}" { permission java.lang.reflect.ReflectPermission "suppressAccessChecks"; }; -grant codeBase "${codebase.lucene-test-framework-6.5.0-snapshot-f919485.jar}" { +grant codeBase "${codebase.lucene-test-framework-6.5.0-snapshot-d00c5ca.jar}" { // needed by RamUsageTester permission java.lang.reflect.ReflectPermission "suppressAccessChecks"; // needed for testing hardlinks in StoreRecoveryTests since we install MockFS diff --git a/core/src/test/java/org/elasticsearch/index/query/QueryStringQueryBuilderTests.java b/core/src/test/java/org/elasticsearch/index/query/QueryStringQueryBuilderTests.java index 96c51d6f94a..9d659b42573 100644 --- a/core/src/test/java/org/elasticsearch/index/query/QueryStringQueryBuilderTests.java +++ b/core/src/test/java/org/elasticsearch/index/query/QueryStringQueryBuilderTests.java @@ -24,11 +24,11 @@ import org.apache.lucene.index.Term; import org.apache.lucene.queryparser.classic.MapperQueryParser; import org.apache.lucene.queryparser.classic.QueryParserSettings; import org.apache.lucene.search.BooleanClause; +import org.apache.lucene.search.BooleanClause.Occur; import org.apache.lucene.search.BooleanQuery; import org.apache.lucene.search.BoostQuery; import org.apache.lucene.search.DisjunctionMaxQuery; import org.apache.lucene.search.FuzzyQuery; -import org.apache.lucene.search.GraphQuery; import org.apache.lucene.search.MatchAllDocsQuery; import org.apache.lucene.search.MatchNoDocsQuery; import org.apache.lucene.search.MultiTermQuery; @@ -40,7 +40,9 @@ import org.apache.lucene.search.SynonymQuery; import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TermRangeQuery; import org.apache.lucene.search.WildcardQuery; -import org.apache.lucene.search.BooleanClause.Occur; +import org.apache.lucene.search.spans.SpanNearQuery; +import org.apache.lucene.search.spans.SpanOrQuery; +import org.apache.lucene.search.spans.SpanTermQuery; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.automaton.TooComplexToDeterminizeException; import org.elasticsearch.common.ParsingException; @@ -396,26 +398,24 @@ public class QueryStringQueryBuilderTests extends AbstractQueryTestCase> PREBUILT_TOKENIZERS;