This is an automated email from the ASF dual-hosted git repository.

jsinovassinnaik pushed a commit to branch UNOMI-780-backport-use-scroll-queries
in repository https://gitbox.apache.org/repos/asf/unomi.git

commit 0644c2ed025758b1934676fbd3224265984ad0ee
Author: jsinovassin <58434978+jsinovas...@users.noreply.github.com>
AuthorDate: Fri May 12 10:02:54 2023 +0100

    UNOMI-780 : Allow to use scroll query to get more than 10000 events (#621)
---
 .../java/org/apache/unomi/services/impl/events/EventServiceImpl.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git 
a/services/src/main/java/org/apache/unomi/services/impl/events/EventServiceImpl.java
 
b/services/src/main/java/org/apache/unomi/services/impl/events/EventServiceImpl.java
index 3465bfddc..8cd7bef13 100644
--- 
a/services/src/main/java/org/apache/unomi/services/impl/events/EventServiceImpl.java
+++ 
b/services/src/main/java/org/apache/unomi/services/impl/events/EventServiceImpl.java
@@ -260,11 +260,14 @@ public class EventServiceImpl implements EventService {
 
     @Override
     public PartialList<Event> search(Query query) {
+        if (query.getScrollIdentifier() != null) {
+            return persistenceService.continueScrollQuery(Event.class, 
query.getScrollIdentifier(), query.getScrollTimeValidity());
+        }
         if (query.getCondition() != null && 
definitionsService.resolveConditionType(query.getCondition())) {
             if (StringUtils.isNotBlank(query.getText())) {
                 return persistenceService.queryFullText(query.getText(), 
query.getCondition(), query.getSortby(), Event.class, query.getOffset(), 
query.getLimit());
             } else {
-                return persistenceService.query(query.getCondition(), 
query.getSortby(), Event.class, query.getOffset(), query.getLimit());
+                return persistenceService.query(query.getCondition(), 
query.getSortby(), Event.class, query.getOffset(), query.getLimit(), 
query.getScrollTimeValidity());
             }
         } else {
             if (StringUtils.isNotBlank(query.getText())) {

Reply via email to