wu-sheng commented on a change in pull request #5132:
URL: https://github.com/apache/skywalking/pull/5132#discussion_r470465252



##########
File path: 
oap-server/server-library/library-client/src/main/java/org/apache/skywalking/oap/server/library/client/elasticsearch/ElasticSearchClient.java
##########
@@ -325,15 +327,24 @@ public boolean createTemplate(String indexName, 
Map<String, Object> settings,
 
     public boolean deleteTemplate(String indexName) throws IOException {
         indexName = formatIndexName(indexName);
-
-        Response response = client.getLowLevelClient()
-                                  .performRequest(HttpDelete.METHOD_NAME, 
"/_template/" + indexName);
+        Response response = 
client.getLowLevelClient().performRequest(HttpDelete.METHOD_NAME, "/_template/" 
+ indexName);
         return response.getStatusLine().getStatusCode() == HttpStatus.SC_OK;
     }
 
+    public SearchResponse search(IndexNameMaker indexNameMaker, 
SearchSourceBuilder searchSourceBuilder) throws IOException {
+        String[] indexNames = 
Arrays.stream(indexNameMaker.make()).map(this::formatIndexName).toArray(String[]::new);
+        return doSearch(searchSourceBuilder, indexNames);
+    }
+
     public SearchResponse search(String indexName, SearchSourceBuilder 
searchSourceBuilder) throws IOException {
         indexName = formatIndexName(indexName);
-        SearchRequest searchRequest = new SearchRequest(indexName);
+        return doSearch(searchSourceBuilder, indexName);

Review comment:
       You refactor this method, but forgot the `indexName = 
formatIndexName(indexName);`, which is used to exist.
   
   I think that is the reason, your PR is not working.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to