Skip to content

Commit

Permalink
sync up with opensearch 2.9
Browse files Browse the repository at this point in the history
  • Loading branch information
marevol committed Jul 27, 2023
1 parent 81e2943 commit 4a1a9a4
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 44 deletions.
2 changes: 1 addition & 1 deletion module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<!-- Maven Repository -->
<property name="maven.snapshot.repo.url" value="https://maven.codelibs.org/" />
<property name="maven.release.repo.url" value="https://maven.codelibs.org/" />
<property name="opensearch.version" value="2.8.0" />
<property name="opensearch.version" value="2.9.0" />

<target name="install.modules">
<mkdir dir="${target.dir}" />
Expand Down
16 changes: 8 additions & 8 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,35 +17,35 @@
<param name="plugin.groupId" value="org/codelibs/opensearch" />
<param name="plugin.name.prefix" value="opensearch-" />
<param name="plugin.name" value="analysis-extension" />
<param name="plugin.version" value="2.8.0" />
<param name="plugin.zip.version" value="2.8.0" />
<param name="plugin.version" value="2.9.0" />
<param name="plugin.zip.version" value="2.9.0" />
</antcall>
<!-- analysis-fess -->
<antcall target="install.plugin">
<param name="repo.url" value="${maven.release.repo.url}" />
<param name="plugin.groupId" value="org/codelibs/opensearch" />
<param name="plugin.name.prefix" value="opensearch-" />
<param name="plugin.name" value="analysis-fess" />
<param name="plugin.version" value="2.8.0" />
<param name="plugin.zip.version" value="2.8.0" />
<param name="plugin.version" value="2.9.0" />
<param name="plugin.zip.version" value="2.9.0" />
</antcall>
<!-- configsync -->
<antcall target="install.plugin">
<param name="repo.url" value="${maven.release.repo.url}" />
<param name="plugin.groupId" value="org/codelibs/opensearch" />
<param name="plugin.name.prefix" value="opensearch-" />
<param name="plugin.name" value="configsync" />
<param name="plugin.version" value="2.8.0" />
<param name="plugin.zip.version" value="2.8.0" />
<param name="plugin.version" value="2.9.0" />
<param name="plugin.zip.version" value="2.9.0" />
</antcall>
<!-- minhash -->
<antcall target="install.plugin">
<param name="repo.url" value="${maven.release.repo.url}" />
<param name="plugin.groupId" value="org/codelibs/opensearch" />
<param name="plugin.name.prefix" value="opensearch-" />
<param name="plugin.name" value="minhash" />
<param name="plugin.version" value="2.8.0" />
<param name="plugin.zip.version" value="2.8.0" />
<param name="plugin.version" value="2.9.0" />
<param name="plugin.zip.version" value="2.9.0" />
</antcall>

<antcall target="remove.jars" />
Expand Down
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1007,6 +1007,12 @@
<groupId>org.opensearch</groupId>
<artifactId>opensearch</artifactId>
<version>${opensearch.version}</version>
<exclusions>
<exclusion>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.codelibs.opensearch</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@
import org.opensearch.client.AdminClient;
import org.opensearch.client.Client;
import org.opensearch.cluster.metadata.MappingMetadata;
import org.opensearch.common.collect.ImmutableOpenMap;
import org.opensearch.common.document.DocumentField;
import org.opensearch.common.settings.Settings;
import org.opensearch.common.settings.Settings.Builder;
Expand Down Expand Up @@ -550,7 +549,7 @@ public void addMapping(final String index, final String docType, final String in

final GetMappingsResponse getMappingsResponse =
client.admin().indices().prepareGetMappings(indexName).execute().actionGet(fessConfig.getIndexIndicesTimeout());
final ImmutableOpenMap<String, MappingMetadata> indexMappings = getMappingsResponse.mappings();
final Map<String, MappingMetadata> indexMappings = getMappingsResponse.mappings();
if (indexMappings == null || !indexMappings.containsKey("properties")) {
String source = null;
final String mappingFile = getResourcePath(indexConfigPath, fessConfig.getFesenType(), "/" + index + "/" + docType + ".json");
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/codelibs/fess/util/UpgradeUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package org.codelibs.fess.util;

import java.io.File;
import java.util.Map;
import java.util.function.Consumer;

import org.apache.logging.log4j.LogManager;
Expand All @@ -35,7 +36,6 @@
import org.opensearch.client.Client;
import org.opensearch.client.IndicesAdminClient;
import org.opensearch.cluster.metadata.MappingMetadata;
import org.opensearch.common.collect.ImmutableOpenMap;
import org.opensearch.common.xcontent.XContentType;

public final class UpgradeUtil {
Expand Down Expand Up @@ -93,7 +93,7 @@ public static boolean addMapping(final IndicesAdminClient indicesClient, final S
final FessConfig fessConfig = ComponentUtil.getFessConfig();
final GetMappingsResponse getMappingsResponse =
indicesClient.prepareGetMappings(index).execute().actionGet(fessConfig.getIndexIndicesTimeout());
final ImmutableOpenMap<String, MappingMetadata> indexMappings = getMappingsResponse.mappings();
final Map<String, MappingMetadata> indexMappings = getMappingsResponse.mappings();
if (indexMappings == null || !indexMappings.containsKey("properties")) {
String source = null;
final String mappingFile = indexResourcePath + "/" + docType + ".json";
Expand Down
16 changes: 0 additions & 16 deletions src/main/resources/fess_indices/fess/ja/mapping.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
#
# Copyright (C) 2016 Shinji Ikeda All Rights Reserved.
# Copyright 2009-2017 CodeLibs Project
#
# Licensed 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.

\u0009 => \u0020
\u000A => \u0020
\u000B => \u0020
Expand Down
15 changes: 0 additions & 15 deletions src/main/resources/fess_indices/fess/mapping.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
# Copyright (C) 2016 Shinji Ikeda All Rights Reserved.
# Copyright 2009-2017 CodeLibs Project
#
# Licensed 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.

\u0009 => \u0020
\u000A => \u0020
\u000B => \u0020
Expand Down

0 comments on commit 4a1a9a4

Please sign in to comment.