Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query setScrollTime not working on reactive search #1974

Closed
leejongchan opened this issue Oct 26, 2021 · 2 comments · Fixed by #1975
Closed

Query setScrollTime not working on reactive search #1974

leejongchan opened this issue Oct 26, 2021 · 2 comments · Fixed by #1975
Labels
type: bug A general bug

Comments

@leejongchan
Copy link
Contributor

leejongchan commented Oct 26, 2021

Probably there is no any setScrollTime process when using search method with reactiveElasticsearchTemplate.

Code

NativeSearchQuery nativeSearchQuery = new NativeSearchQueryBuilder()
   .withQuery(QueryBuilders.matchAllQuery())
   .build();
nativeSearchQuery.setScrollTime(Duration.ofHours(6));

var result = reactiveElasticsearchTemplate.search(nativeSearchQuery,ESChannelProduct.class).then();

Log

2021-10-26 16:52:36.408 DEBUG 76393 --- [main] o.s.w.r.f.client.ExchangeFunctions       : [-] HTTP POST {hidden url}/channelproduct/_search?typed_keys=true&ignore_unavailable=false&expand_wildcards=open&allow_no_indices=true&scroll=1m&search_type=query_then_fetch&batched_reduce_size=512
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Oct 26, 2021
@sothawo sothawo added the type: bug A general bug label Oct 26, 2021
@sothawo sothawo added this to the 4.3 GA (2021.1.0) milestone Oct 26, 2021
@sothawo sothawo changed the title NativeSearchQuery setScrollTime not working Query setScrollTime not working on reactive search Oct 26, 2021
@sothawo sothawo linked a pull request Oct 26, 2021 that will close this issue
5 tasks
sothawo pushed a commit that referenced this issue Oct 26, 2021
sothawo pushed a commit that referenced this issue Oct 26, 2021
Original Pull Request #1975
Closes #1974

(cherry picked from commit f1b4a54)
sothawo pushed a commit that referenced this issue Oct 26, 2021
Original Pull Request #1975
Closes #1974

(cherry picked from commit f1b4a54)
(cherry picked from commit c1ab4d6)
@sothawo sothawo removed the status: waiting-for-triage An issue we've not yet triaged label Oct 26, 2021
@leejongchan
Copy link
Contributor Author

hi, @sothawo. I have a question.

Is there any way to use setScrollTime with spring-data-elasticsearch:4.1.5?
I can not find how to set scroll time with this version.

@sothawo
Copy link
Collaborator

sothawo commented Oct 28, 2021

Query.setScrollTime(Duration) was added in verison 4.0. The fix from this issue has been backported to the 4.1.x branch. But I'm not sure if there will be a further service release as OSS support for 4.1 ends in November 2021 (https://github.com/spring-projects/spring-data-commons/wiki/Release-Train-Ockham-2020.0.0) and 4.1.14 was released 10 days ago.

So you should better update to a more recent version of Spring Data Elasticsearch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants