Skip to content

Commit

Permalink
fix(mod-search): fix export of cql files
Browse files Browse the repository at this point in the history
- Fix condition

Closes: MSEARCH-762
  • Loading branch information
viacheslavpoliakov committed Jun 11, 2024
1 parent 6a5e99e commit b031429
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/org/folio/search/service/ResourceIdService.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ protected OutputStreamWriter createOutputStreamWriter(OutputStream outputStream)
}

private void streamResourceIds(CqlResourceIdsRequest request, Consumer<List<String>> idsConsumer) {
boolean notSharedActiveAffiliation = request.getTenantId().equalsIgnoreCase("consortium")
|| request.getQuery().contains("shared==\"true\"");
boolean notSharedActiveAffiliation = !request.getTenantId().equalsIgnoreCase("consortium")
&& request.getQuery().contains("shared==\"false\"");

var searchSource = getSearchSource(request, notSharedActiveAffiliation)
.size(streamIdsProperties.getScrollQuerySize())
Expand All @@ -151,8 +151,8 @@ private void streamResourceIds(CqlResourceIdsRequest request, Consumer<List<Stri

private SearchSourceBuilder getSearchSource(CqlResourceIdsRequest req, boolean notSharedActiveAffiliation) {
return notSharedActiveAffiliation
? queryConverter.convertForConsortia(req.getQuery(), req.getResource())
: queryConverter.convertNotSharedActiveAffiliation(req.getQuery(), req.getResource(), req.getTenantId());
? queryConverter.convertNotSharedActiveAffiliation(req.getQuery(), req.getResource(), req.getTenantId())
: queryConverter.convertForConsortia(req.getQuery(), req.getResource());
}

private void processStreamToJson(OutputStream outputStream,
Expand Down

0 comments on commit b031429

Please sign in to comment.