You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by fo...@apache.org on 2022/02/04 07:58:27 UTC
[jackrabbit-oak] branch trunk updated: OAK-9683 Bump elasticsearch version to 7.16.3 (#481)
This is an automated email from the ASF dual-hosted git repository.
fortino pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git
The following commit(s) were added to refs/heads/trunk by this push:
new f56cb2d OAK-9683 Bump elasticsearch version to 7.16.3 (#481)
f56cb2d is described below
commit f56cb2d12f253b1bc281bac0114d908fe4328fe4
Author: Angela Fabregues <an...@gmail.com>
AuthorDate: Fri Feb 4 08:58:21 2022 +0100
OAK-9683 Bump elasticsearch version to 7.16.3 (#481)
* OAK-9683 Bump elasticsearch version to 7.16.3
* OAK-9683 Bump elasticsearch version to 7.16.3
* OAK-9683 Bump elasticsearch version to 7.16.3
* OAK-9683 Bump elasticsearch version to 7.16.3
Co-authored-by: Angela Fabregues <an...@netcentric.biz>
---
oak-run-elastic/pom.xml | 5 +++--
oak-search-elastic/pom.xml | 4 ++--
.../jackrabbit/oak/plugins/index/elastic/ElasticConnection.java | 2 +-
.../plugins/index/elastic/index/ElasticBulkProcessorHandler.java | 8 ++++----
.../oak/plugins/index/elastic/index/ElasticDocument.java | 4 ++--
.../oak/plugins/index/elastic/index/ElasticIndexHelper.java | 4 ++--
.../oak/plugins/index/elastic/index/ElasticIndexWriter.java | 6 +++---
.../oak/plugins/index/elastic/query/ElasticRequestHandler.java | 8 ++++----
.../oak/plugins/index/elastic/ElasticConnectionRule.java | 4 ++--
.../oak/plugins/index/elastic/ElasticSimilarQueryTest.java | 4 ++--
oak-search-elastic/src/test/resources/elasticstartscript.sh | 2 +-
11 files changed, 26 insertions(+), 25 deletions(-)
diff --git a/oak-run-elastic/pom.xml b/oak-run-elastic/pom.xml
index d4f569c..7e65124 100644
--- a/oak-run-elastic/pom.xml
+++ b/oak-run-elastic/pom.xml
@@ -35,9 +35,10 @@
<groovy.version>2.4.17</groovy.version>
<!--
Size History:
- 98 MB : Seeting constraint to default oak-run jar post adding the build plugin to rename the fat jar with embedded dependencies as the default jar.
+ 102 MB : Seeting constraint to default oak-run jar post adding the build plugin to rename the fat jar with embedded dependencies as the default jar.
-->
- <max.jar.size>98000000</max.jar.size>
+ <max.jar.size>102000000</max.jar.size>
+
</properties>
<build>
diff --git a/oak-search-elastic/pom.xml b/oak-search-elastic/pom.xml
index f938f1b..260b2f5 100644
--- a/oak-search-elastic/pom.xml
+++ b/oak-search-elastic/pom.xml
@@ -33,8 +33,8 @@
<description>Oak Elasticsearch integration subproject</description>
<properties>
- <elasticsearch.version>7.10.2</elasticsearch.version>
- <lucene.version>8.7.0</lucene.version>
+ <elasticsearch.version>7.16.3</elasticsearch.version>
+ <lucene.version>8.10.1</lucene.version>
</properties>
<build>
diff --git a/oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/ElasticConnection.java b/oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/ElasticConnection.java
index 3927a7d..4c49071 100644
--- a/oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/ElasticConnection.java
+++ b/oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/ElasticConnection.java
@@ -126,7 +126,7 @@ public class ElasticConnection implements Closeable {
public boolean isAvailable() {
try {
return this.getClient().ping(RequestOptions.DEFAULT);
- } catch (IOException e) {
+ } catch (Exception e) {
LOG.warn("Error checking connection for {}, message: {}", this, e.getMessage());
LOG.debug("", e);
return false;
diff --git a/oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/index/ElasticBulkProcessorHandler.java b/oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/index/ElasticBulkProcessorHandler.java
index 9cc6ecd..997bc55 100644
--- a/oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/index/ElasticBulkProcessorHandler.java
+++ b/oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/index/ElasticBulkProcessorHandler.java
@@ -36,7 +36,7 @@ import org.elasticsearch.action.support.WriteRequest;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.unit.ByteSizeValue;
-import org.elasticsearch.common.unit.TimeValue;
+import org.elasticsearch.core.TimeValue;
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -52,8 +52,8 @@ import java.util.concurrent.atomic.AtomicBoolean;
import java.util.function.BiConsumer;
import java.util.stream.Collectors;
-import static org.elasticsearch.common.xcontent.ToXContent.EMPTY_PARAMS;
-import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
+import static org.elasticsearch.xcontent.ToXContent.EMPTY_PARAMS;
+import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
class ElasticBulkProcessorHandler {
@@ -146,7 +146,7 @@ class ElasticBulkProcessorHandler {
private BulkProcessor initBulkProcessor() {
return BulkProcessor.builder(requestConsumer(),
- new OakBulkProcessorListener())
+ new OakBulkProcessorListener(), this.indexName + "-bulk-processor")
.setBulkActions(indexDefinition.bulkActions)
.setBulkSize(new ByteSizeValue(indexDefinition.bulkSizeBytes))
.setFlushInterval(TimeValue.timeValueMillis(indexDefinition.bulkFlushIntervalMs))
diff --git a/oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/index/ElasticDocument.java b/oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/index/ElasticDocument.java
index bc66ef9..847fa09 100644
--- a/oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/index/ElasticDocument.java
+++ b/oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/index/ElasticDocument.java
@@ -22,8 +22,8 @@ import org.apache.jackrabbit.oak.plugins.index.elastic.ElasticIndexDefinition;
import org.apache.jackrabbit.oak.plugins.index.search.FieldNames;
import org.apache.jackrabbit.oak.plugins.index.search.spi.binary.BlobByteSource;
import org.elasticsearch.common.Strings;
-import org.elasticsearch.common.xcontent.XContentBuilder;
-import org.elasticsearch.common.xcontent.XContentFactory;
+import org.elasticsearch.xcontent.XContentBuilder;
+import org.elasticsearch.xcontent.XContentFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/index/ElasticIndexHelper.java b/oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/index/ElasticIndexHelper.java
index 15f4ba0..8023f6b 100644
--- a/oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/index/ElasticIndexHelper.java
+++ b/oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/index/ElasticIndexHelper.java
@@ -24,8 +24,8 @@ import org.apache.jackrabbit.oak.plugins.index.search.PropertyDefinition;
import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsRequest;
import org.elasticsearch.client.indices.CreateIndexRequest;
import org.elasticsearch.common.settings.Settings;
-import org.elasticsearch.common.xcontent.XContentBuilder;
-import org.elasticsearch.common.xcontent.XContentFactory;
+import org.elasticsearch.xcontent.XContentBuilder;
+import org.elasticsearch.xcontent.XContentFactory;
import java.io.IOException;
import java.util.List;
diff --git a/oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/index/ElasticIndexWriter.java b/oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/index/ElasticIndexWriter.java
index c2a0ac3..99494de 100644
--- a/oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/index/ElasticIndexWriter.java
+++ b/oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/index/ElasticIndexWriter.java
@@ -39,7 +39,7 @@ import org.elasticsearch.client.indices.CreateIndexResponse;
import org.elasticsearch.client.indices.GetIndexRequest;
import org.elasticsearch.cluster.metadata.AliasMetadata;
import org.elasticsearch.common.Strings;
-import org.elasticsearch.common.xcontent.XContentType;
+import org.elasticsearch.xcontent.XContentType;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.TestOnly;
import org.slf4j.Logger;
@@ -50,8 +50,8 @@ import java.util.Map;
import java.util.Set;
import java.util.UUID;
-import static org.elasticsearch.common.xcontent.ToXContent.EMPTY_PARAMS;
-import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
+import static org.elasticsearch.xcontent.ToXContent.EMPTY_PARAMS;
+import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
class ElasticIndexWriter implements FulltextIndexWriter<ElasticDocument> {
private static final Logger LOG = LoggerFactory.getLogger(ElasticIndexWriter.class);
diff --git a/oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/query/ElasticRequestHandler.java b/oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/query/ElasticRequestHandler.java
index 25fb93e..0960d52 100644
--- a/oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/query/ElasticRequestHandler.java
+++ b/oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/query/ElasticRequestHandler.java
@@ -49,12 +49,12 @@ import org.apache.jackrabbit.oak.spi.state.NodeState;
import org.apache.lucene.search.WildcardQuery;
import org.apache.lucene.search.join.ScoreMode;
import org.elasticsearch.common.Strings;
-import org.elasticsearch.common.xcontent.XContentBuilder;
-import org.elasticsearch.common.xcontent.json.JsonXContent;
+import org.elasticsearch.xcontent.XContentBuilder;
+import org.elasticsearch.xcontent.json.JsonXContent;
import org.apache.lucene.util.BytesRef;
import org.elasticsearch.client.Request;
import org.elasticsearch.common.xcontent.XContentHelper;
-import org.elasticsearch.common.xcontent.XContentType;
+import org.elasticsearch.xcontent.XContentType;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.InnerHitBuilder;
import org.elasticsearch.index.query.MatchBoolPrefixQueryBuilder;
@@ -113,7 +113,7 @@ import static org.apache.jackrabbit.oak.plugins.index.elastic.util.TermQueryBuil
import static org.apache.jackrabbit.oak.spi.query.QueryConstants.JCR_PATH;
import static org.apache.jackrabbit.oak.spi.query.QueryConstants.JCR_SCORE;
import static org.apache.jackrabbit.util.ISO8601.parse;
-import static org.elasticsearch.common.xcontent.ToXContent.EMPTY_PARAMS;
+import static org.elasticsearch.xcontent.ToXContent.EMPTY_PARAMS;
import static org.elasticsearch.index.query.MoreLikeThisQueryBuilder.Item;
import static org.elasticsearch.index.query.QueryBuilders.boolQuery;
import static org.elasticsearch.index.query.QueryBuilders.functionScoreQuery;
diff --git a/oak-search-elastic/src/test/java/org/apache/jackrabbit/oak/plugins/index/elastic/ElasticConnectionRule.java b/oak-search-elastic/src/test/java/org/apache/jackrabbit/oak/plugins/index/elastic/ElasticConnectionRule.java
index 395d74f..e893197 100644
--- a/oak-search-elastic/src/test/java/org/apache/jackrabbit/oak/plugins/index/elastic/ElasticConnectionRule.java
+++ b/oak-search-elastic/src/test/java/org/apache/jackrabbit/oak/plugins/index/elastic/ElasticConnectionRule.java
@@ -53,7 +53,7 @@ public class ElasticConnectionRule extends ExternalResource {
private static final Logger LOG = LoggerFactory.getLogger(ElasticConnectionRule.class);
private static final String INDEX_PREFIX = "elastic_test";
- private static final String PLUGIN_DIGEST = "060117b4150c87274d9cff0925ec16e714f28a40906a53a2cd2a23322bbb3189";
+ private static final String PLUGIN_DIGEST = "db479aeee452b2a0f6e3c619ecdf27ca5853e54e7bc787e5c56a49899c249240";
private static boolean useDocker = false;
private final String elasticConnectionString;
@@ -71,7 +71,7 @@ public class ElasticConnectionRule extends ExternalResource {
public Statement apply(Statement base, Description description) {
Statement s = super.apply(base, description);
// see if docker is to be used or not... initialize docker rule only if that's the case.
- final String pluginVersion = "7.10.2.3";
+ final String pluginVersion = "7.16.3.0";
final String pluginFileName = "elastiknn-" + pluginVersion + ".zip";
final String localPluginPath = "target/" + pluginFileName;
downloadSimilaritySearchPluginIfNotExists(localPluginPath, pluginVersion);
diff --git a/oak-search-elastic/src/test/java/org/apache/jackrabbit/oak/plugins/index/elastic/ElasticSimilarQueryTest.java b/oak-search-elastic/src/test/java/org/apache/jackrabbit/oak/plugins/index/elastic/ElasticSimilarQueryTest.java
index c7c9898..a7c4961 100644
--- a/oak-search-elastic/src/test/java/org/apache/jackrabbit/oak/plugins/index/elastic/ElasticSimilarQueryTest.java
+++ b/oak-search-elastic/src/test/java/org/apache/jackrabbit/oak/plugins/index/elastic/ElasticSimilarQueryTest.java
@@ -235,7 +235,7 @@ public class ElasticSimilarQueryTest extends ElasticAbstractQueryTest {
IndexDefinitionBuilder builder = createIndex(fieldName1);
Tree tree = builder.indexRule("nt:base").property(fieldName1).useInSimilarity(true).nodeScopeIndex()
.similaritySearchDenseVectorSize(2048).getBuilderTree();
- tree.setProperty(ElasticPropertyDefinition.PROP_INDEX_SIMILARITY, "angular");
+ tree.setProperty(ElasticPropertyDefinition.PROP_INDEX_SIMILARITY, "cosine");
tree.setProperty(ElasticPropertyDefinition.PROP_NUMBER_OF_HASH_TABLES, 10);
tree.setProperty(ElasticPropertyDefinition.PROP_NUMBER_OF_HASH_FUNCTIONS, 12);
@@ -253,7 +253,7 @@ public class ElasticSimilarQueryTest extends ElasticAbstractQueryTest {
Map<String, Object> map1 = (Map<String, Object>)(((Map<String, Object>)mappings.entrySet().iterator().next().getValue().
get(similarityFieldName1).sourceAsMap().get(similarityFieldName1)).get("elastiknn"));
assertEquals("Dense vector size doesn't match", 2048, (int)map1.get("dims"));
- assertEquals("Similarity doesn't match", "angular", map1.get("similarity"));
+ assertEquals("Similarity doesn't match", "cosine", map1.get("similarity"));
assertEquals("Similarity doesn't match", 10, map1.get("L"));
assertEquals("Similarity doesn't match", 12, map1.get("k"));
}
diff --git a/oak-search-elastic/src/test/resources/elasticstartscript.sh b/oak-search-elastic/src/test/resources/elasticstartscript.sh
index a2a299b..e6f5e87 100644
--- a/oak-search-elastic/src/test/resources/elasticstartscript.sh
+++ b/oak-search-elastic/src/test/resources/elasticstartscript.sh
@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-pluginZip=`ls /tmp/plugins | grep elastiknn-7.10 | head -n 1`
+pluginZip=`ls /tmp/plugins | grep elastiknn-7.16 | head -n 1`
echo "Installing plugin /tmp/plugins/$pluginZip"
bin/elasticsearch-plugin install --batch file:///tmp/plugins/$pluginZip
su -c "bin/elasticsearch" elasticsearch
\ No newline at end of file