diff --git a/elastic/src/main/java/org/openmbee/mms/elastic/services/ElasticSearchService.java b/elastic/src/main/java/org/openmbee/mms/elastic/services/ElasticSearchService.java index 13b8798c2..74bb12b70 100644 --- a/elastic/src/main/java/org/openmbee/mms/elastic/services/ElasticSearchService.java +++ b/elastic/src/main/java/org/openmbee/mms/elastic/services/ElasticSearchService.java @@ -209,20 +209,20 @@ private List performElasticQuery(Set allNodeDocIds, SearchR sourceBuilder.query(query); sourceBuilder.size(resultLimit); searchRequest.source(sourceBuilder); - searchRequest.scroll(TimeValue.timeValueMillis(scrollTimeout)); + searchRequest.scroll(TimeValue.timeValueSeconds(scrollTimeout)); SearchResponse searchResponse = client.search(searchRequest, RequestOptions.DEFAULT); String scrollId = null; - do { - for(SearchHit hit : searchResponse.getHits()) { + for (SearchHit hit : searchResponse.getHits()) { ElementJson ob = parseResult(hit); - if(allNodeDocIds.contains(ob.getDocId())) { + if (allNodeDocIds.contains(ob.getDocId())) { result.add(ob); } } scrollId = searchResponse.getScrollId(); if (scrollId != null) { SearchScrollRequest scrollRequest = new SearchScrollRequest(scrollId); + scrollRequest.scroll(TimeValue.timeValueSeconds(scrollTimeout)); searchResponse = client.scroll(scrollRequest, RequestOptions.DEFAULT); } @@ -255,8 +255,6 @@ private Collection> filterIndexedElementsUsingDatabas } else if(showDeletedAsRejected) { deletedElements.add(new OrderedResult<>(new Rejection(currentJson.getWrapped(), 410, SearchConstants.ELEMENT_DELETED_INFO), currentJson.getOrder())); } - } else { // node found in DB not found in the index - logger.warn(SearchConstants.POSSIBLE_ELASTIC_DISCREPANCY, n.getNodeId()); } } diff --git a/gradle.properties b/gradle.properties index 45e227a6e..19a237b8b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -version=4.0.16 +version=4.0.17 group=org.openmbee.mms springBootVersion=2.6.7