Skip to content

Commit

Permalink
修复search接口查询havenask索引时转发到havenask search模块的索引类型判断异常 (#344)
Browse files Browse the repository at this point in the history
  • Loading branch information
Huaixinww authored Nov 30, 2023
1 parent 93bf0ad commit ec313bc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ public void testIsSearchHavenask() {

private Metadata initMetadata() {
IndexMetadata.Builder index1 = IndexMetadata.builder("havenask-1")
.settings(Settings.builder().put(IndexMetadata.SETTING_VERSION_CREATED, Version.CURRENT).put("index.engine.type", "havenask"))
.settings(Settings.builder().put(IndexMetadata.SETTING_VERSION_CREATED, Version.CURRENT).put("index.engine", "havenask"))
.numberOfShards(1)
.numberOfReplicas(0);
IndexMetadata.Builder index2 = IndexMetadata.builder("havenask-2")
.settings(Settings.builder().put(IndexMetadata.SETTING_VERSION_CREATED, Version.CURRENT).put("index.engine.type", "havenask"))
.settings(Settings.builder().put(IndexMetadata.SETTING_VERSION_CREATED, Version.CURRENT).put("index.engine", "havenask"))
.numberOfShards(1)
.numberOfReplicas(0)
.putAlias(AliasMetadata.builder("havenask-alias-1"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ public static boolean isSearchHavenask(Metadata metadata, SearchRequest searchRe

if (indexAbstraction instanceof IndexAbstraction.Index) {
IndexMetadata indexMetadata = indexAbstraction.getWriteIndex();
if ("havenask".equals(indexMetadata.getSettings().get("index.engine.type"))) {
if ("havenask".equals(indexMetadata.getSettings().get("index.engine"))) {
// havenask索引
return true;
} else {
Expand All @@ -286,7 +286,7 @@ public static boolean isSearchHavenask(Metadata metadata, SearchRequest searchRe
}

IndexMetadata indexMetadata = indexAbstraction.getWriteIndex();
if ("havenask".equals(indexMetadata.getSettings().get("index.engine.type"))) {
if ("havenask".equals(indexMetadata.getSettings().get("index.engine"))) {
// havenask索引
return true;
} else {
Expand Down

0 comments on commit ec313bc

Please sign in to comment.