Skip to content

Commit

Permalink
[update][plugin][esreader] Simplify condition judge
Browse files Browse the repository at this point in the history
  • Loading branch information
wgzhao committed Oct 30, 2024
1 parent 373febe commit 00eded8
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,21 +100,19 @@ public boolean indicesExists(String indexName)
boolean isIndicesExists = false;
JestResult rst = jestClient.execute(new IndicesExists.Builder(indexName).build());
if (rst.isSucceeded()) {
isIndicesExists = true;
return true;
}
else {
switch (rst.getResponseCode()) {
case 404:
isIndicesExists = false;
break;
return false;
case 401:
// 无权访问
default:
log.warn(rst.getErrorMessage());
break;
return false;
}
}
return isIndicesExists;
}

public SearchResult search(String query,
Expand Down

0 comments on commit 00eded8

Please sign in to comment.