Fixed
Details
Assignee
Yoann RodièreYoann RodièreReporter
Yoann RodièreYoann RodièreComponents
Sprint
NoneFix versions
Priority
Major
Details
Details
Assignee
Yoann Rodière
Yoann RodièreReporter
Yoann Rodière
Yoann RodièreComponents
Sprint
None
Fix versions
Priority
Created July 30, 2020 at 4:04 PM
Updated September 4, 2020 at 1:07 PM
Resolved August 17, 2020 at 11:06 AM
Implement
scroll()
andscroll(ScrollMode)
inHibernateOrmSearchQueryAdapter
, relying onSearchQuery#scroll(int)
under the scene.Only
ScrollMode.FORWARD_ONLY
will be supported.We will need to decide on a page size. Let's use the same size as the loading fetch size, which should be accessible from
org.hibernate.search.mapper.orm.search.loading.impl.MutableEntityLoadingOptions#getFetchSize
.Some internal windowing will probably be necessary. Just copy/paste the
org.hibernate.search.elasticsearch.util.impl.Window
class from Search 5 and adapt it. Do not forget to also copy the unit test,org.hibernate.search.elasticsearch.test.WindowTest
.See
org.hibernate.search.query.hibernate.impl.ScrollableResultsImpl
for an example of how it was done in Search 5 (may or may not be helpful).Add tests for
scroll()
andscroll(ScrollMode)
inorg.hibernate.search.integrationtest.mapper.orm.hibernateormapis.ToHibernateOrmIT
:Nominal case (create scroll, fetch some hits until all hits have been consumed, close).
Edge cases: not fetching any result (should work fine), fetching some results but not all of them (should work fine), trying to fetch more than the total hit count (should throw an exception).
Error cases: trying to scroll back, trying to call the
get*(int)
methods...Check that using any scroll mode other than ScrollMode.FORWARD_ONLY fails.
Test
query.stream()
too (it's based onscroll()
).Add tests for
getResultStream()
inorg.hibernate.search.integrationtest.mapper.orm.hibernateormapis.ToJpaIT
.