aderm commented on a change in pull request #4353: Optimizing performance reduces es index queries scope by timebucket URL: https://github.com/apache/skywalking/pull/4353#discussion_r378636611
########## File path: oap-server/server-library/library-client/src/main/java/org/apache/skywalking/oap/server/library/client/elasticsearch/ElasticSearchClient.java ########## @@ -291,6 +292,30 @@ public SearchResponse search(String indexName, SearchSourceBuilder searchSourceB return client.search(searchRequest); } + public SearchResponse search(String[] indexNames, SearchSourceBuilder searchSourceBuilder) throws IOException { + String[] fullIndexNames = formatIndexNames(indexNames); + SearchRequest searchRequest = new SearchRequest(fullIndexNames); + searchRequest.types(TYPE); + searchRequest.source(searchSourceBuilder); + return client.search(searchRequest); + } + + public String[] filterNotExistIndex(String[] fullIndexNames, String indName) throws IOException { + // if no wrap, it is impossible to remove elements + List<String> indexNameList = new ArrayList<>(Arrays.asList(fullIndexNames)); + if (fullIndexNames.length > 0) { + List<String> existIndex = retrievalIndexByAliases(indName); + indexNameList.removeIf(indexName -> { + //only filter index name with xxxx-xxxx + if (indexName.contains("-")) { Review comment: server-core module depends on library-client module, so `Const#LINE` in server-core can not used in library-client module. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services