From ef3b9c7cc3ef392ad862edfb375e03134a58a0da Mon Sep 17 00:00:00 2001 From: Doris Lam Date: Fri, 31 Mar 2023 14:05:28 -0700 Subject: [PATCH 1/2] fixes #238 elasticsearch scroll --- .../mms/elastic/services/ElasticSearchService.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) 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()); } } From 1357519c3395566f4f212a163f7c645de07f5743 Mon Sep 17 00:00:00 2001 From: Jason Han Date: Fri, 31 Mar 2023 15:17:24 -0700 Subject: [PATCH 2/2] Bump version for release --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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