mirror of
https://github.com/spring-projects/spring-data-elasticsearch.git
synced 2025-06-14 08:02:11 +00:00
DATAES-421 updated to latest version of ES 6.2.2
This commit is contained in:
parent
e7b93bee90
commit
51f9485700
2
pom.xml
2
pom.xml
@ -19,7 +19,7 @@
|
||||
<properties>
|
||||
<commonscollections>3.2.1</commonscollections>
|
||||
<commonslang>2.6</commonslang>
|
||||
<elasticsearch>6.1.0</elasticsearch>
|
||||
<elasticsearch>6.2.2</elasticsearch>
|
||||
<log4j>2.9.1</log4j>
|
||||
<springdata.commons>2.1.0.BUILD-SNAPSHOT</springdata.commons>
|
||||
<java-module-name>spring.data.elasticsearch</java-module-name>
|
||||
|
@ -29,6 +29,7 @@ import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.elasticsearch.action.ActionFuture;
|
||||
import org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequest;
|
||||
@ -961,16 +962,9 @@ public class ElasticsearchTemplate implements ElasticsearchOperations, Applicati
|
||||
@Override
|
||||
public Map getSetting(String indexName) {
|
||||
Assert.notNull(indexName, "No index defined for getSettings");
|
||||
Settings settings = client.admin().indices().getSettings(new GetSettingsRequest()).actionGet().getIndexToSettings()
|
||||
.get(indexName);
|
||||
|
||||
SortedMap<String, String> settingsMap = new TreeMap<>();
|
||||
|
||||
settings.keySet().forEach((key) -> {
|
||||
settingsMap.put(key, String.valueOf(settings.get(key)));
|
||||
});
|
||||
|
||||
return Collections.unmodifiableSortedMap(settingsMap);
|
||||
Settings settings = client.admin().indices().getSettings(new GetSettingsRequest()).actionGet()
|
||||
.getIndexToSettings().get(indexName);
|
||||
return settings.keySet().stream().collect(Collectors.toMap((key)->key, (key)->settings.get(key)));
|
||||
}
|
||||
|
||||
private <T> SearchRequestBuilder prepareSearch(Query query, Class<T> clazz) {
|
||||
|
@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Licensed to Elasticsearch under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.plugins;
|
||||
|
||||
import java.security.AccessController;
|
||||
import java.security.PrivilegedAction;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* A classloader that is a union over the parent core classloader and classloaders of extended plugins.
|
||||
* Cloned from ES repository
|
||||
* - that file is only available in ES server libs
|
||||
* - and we need it o create a node client for unittests
|
||||
*/
|
||||
public class ExtendedPluginsClassLoader extends ClassLoader {
|
||||
|
||||
/** Loaders of plugins extended by a plugin. */
|
||||
private final List<ClassLoader> extendedLoaders;
|
||||
|
||||
private ExtendedPluginsClassLoader(ClassLoader parent, List<ClassLoader> extendedLoaders) {
|
||||
super(parent);
|
||||
this.extendedLoaders = Collections.unmodifiableList(extendedLoaders);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class<?> findClass(String name) throws ClassNotFoundException {
|
||||
for (ClassLoader loader : extendedLoaders) {
|
||||
try {
|
||||
return loader.loadClass(name);
|
||||
} catch (ClassNotFoundException e) {
|
||||
// continue
|
||||
}
|
||||
}
|
||||
throw new ClassNotFoundException(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a new classloader across the parent and extended loaders.
|
||||
*/
|
||||
public static ExtendedPluginsClassLoader create(ClassLoader parent, List<ClassLoader> extendedLoaders) {
|
||||
return AccessController.doPrivileged((PrivilegedAction<ExtendedPluginsClassLoader>)
|
||||
() -> new ExtendedPluginsClassLoader(parent, extendedLoaders));
|
||||
}
|
||||
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -22,7 +22,7 @@
|
||||
description=Lucene expressions integration for Elasticsearch
|
||||
#
|
||||
# 'version': plugin's version
|
||||
version=6.1.0
|
||||
version=6.2.2
|
||||
#
|
||||
# 'name': the plugin name
|
||||
name=lang-expression
|
||||
@ -37,9 +37,12 @@ classname=org.elasticsearch.script.expression.ExpressionPlugin
|
||||
java.version=1.8
|
||||
#
|
||||
# 'elasticsearch.version': version of elasticsearch compiled against
|
||||
elasticsearch.version=6.1.0
|
||||
elasticsearch.version=6.2.2
|
||||
### optional elements for plugins:
|
||||
#
|
||||
# 'extended.plugins': other plugins this plugin extends through SPI
|
||||
extended.plugins=
|
||||
#
|
||||
# 'has.native.controller': whether or not the plugin has a native controller
|
||||
has.native.controller=false
|
||||
#
|
||||
|
Loading…
x
Reference in New Issue
Block a user