Skip to content

Commit

Permalink
Minor inprovement
Browse files Browse the repository at this point in the history
  • Loading branch information
aarshi0301 committed Nov 14, 2024
1 parent d1e89ca commit 791c348
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ private DirectIndexQueryResult performAsyncDirectIndexQuery(SearchParams searchP
if (searchParams.getRequestTimeoutInSecs() != null) {
KeepAliveTime = searchParams.getRequestTimeoutInSecs() +"s";
}
AsyncQueryResult response = submitAsyncSearch(searchParams, false).get();
AsyncQueryResult response = submitAsyncSearch(searchParams, KeepAliveTime, false).get();
if(response.isRunning()) {
/*
* If the response is still running, then we need to wait for the response
Expand Down Expand Up @@ -358,14 +358,10 @@ public void onFailure(Exception exception) {
lowLevelRestClient.performRequestAsync(request, responseListener);
}

private Future<AsyncQueryResult> submitAsyncSearch(SearchParams searchParams, boolean source) {
private Future<AsyncQueryResult> submitAsyncSearch(SearchParams searchParams, String KeepAliveTime, boolean source) {
CompletableFuture<AsyncQueryResult> future = new CompletableFuture<>();
HttpEntity entity = new NStringEntity(searchParams.getQuery(), ContentType.APPLICATION_JSON);
String endPoint;
String KeepAliveTime = AtlasConfiguration.INDEXSEARCH_ASYNC_SEARCH_KEEP_ALIVE_TIME_IN_SECONDS.getLong() +"s";
if (searchParams.getRequestTimeoutInSecs() != null) {
KeepAliveTime = searchParams.getRequestTimeoutInSecs() +"s";
}

if (source) {
endPoint = index + "/_async_search";
Expand Down

0 comments on commit 791c348

Please sign in to comment.