diff --git a/src/domain-services/flows/flow-search-service.ts b/src/domain-services/flows/flow-search-service.ts index 2c8f5a1c..c7385e2e 100644 --- a/src/domain-services/flows/flow-search-service.ts +++ b/src/domain-services/flows/flow-search-service.ts @@ -849,6 +849,9 @@ export class FlowSearchService { } } + args.flowObjectFilters = flowObjectFilters; + // default limit to increase performance + args.limit = 5000; // Do the first search const flowSearchResponse = await this.search( models, @@ -870,7 +873,6 @@ export class FlowSearchService { databaseConnection, nextArgs ); - flows.push(...nextFlowSearchResponse.flows); hasNextPage = nextFlowSearchResponse.hasNextPage; diff --git a/src/domain-services/flows/strategy/impl/search-flow-by-filters-strategy-impl.ts b/src/domain-services/flows/strategy/impl/search-flow-by-filters-strategy-impl.ts index 09b0161d..3a05624c 100644 --- a/src/domain-services/flows/strategy/impl/search-flow-by-filters-strategy-impl.ts +++ b/src/domain-services/flows/strategy/impl/search-flow-by-filters-strategy-impl.ts @@ -232,7 +232,7 @@ export class SearchFlowByFiltersStrategy implements FlowSearchStrategy { // Then we are going to slice the flows using the limit and offset let reducedFlows: UniqueFlowEntity[]; - if (offset && limit) { + if (offset !== undefined && limit !== undefined) { reducedFlows = sortedFlows.slice(offset, offset + limit); } else { reducedFlows = sortedFlows;