Skip to content

DATAES-680 - ReactiveElasticsearchTemplate-should-use-the-count-API. #341

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

Conversation

sothawo
Copy link
Collaborator

@sothawo sothawo commented Nov 3, 2019

Currently the reactive stack in order to do a count does a search and counts the returned flux. This means that all records are read to get the count which is quite not performant.

This PR uses the count API of Elasticsearch to do a count.

This is somehow related to #340 but I want to keep this in a separate PR, as this feature should be merged into 3.2.x regardless of the rewriting in the current master branch.

@sothawo sothawo requested review from mp911de and xhaggi November 3, 2019 16:44
@sothawo sothawo force-pushed the DATAES-680_-_ReactiveElasticsearchTemplate-should-use-the-count-API branch from 4dca94b to f98fd3c Compare November 4, 2019 18:08
@sothawo sothawo force-pushed the DATAES-680_-_ReactiveElasticsearchTemplate-should-use-the-count-API branch from f98fd3c to b671261 Compare November 5, 2019 10:05
Copy link
Member

@mp911de mp911de left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. At some point, we should extract common code used by imperative and reactive templates (e.g. buildCountRequest, building the search request with SearchSourceBuilder) into a utility such as EntityOperations or a similar one.

@sothawo sothawo merged commit 62385ed into spring-projects:master Nov 6, 2019
@sothawo sothawo deleted the DATAES-680_-_ReactiveElasticsearchTemplate-should-use-the-count-API branch November 6, 2019 18:14
@sothawo
Copy link
Collaborator Author

sothawo commented Nov 6, 2019

I agree. But doing this as long as the TransportClient is supported means additional work which will be obsolete in the near future.

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

Successfully merging this pull request may close these issues.

2 participants