Skip to content

ReactiveElasticsearchClient missing simple count() method #2749

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

Closed
maxio89 opened this issue Oct 29, 2023 · 5 comments · Fixed by #2985
Closed

ReactiveElasticsearchClient missing simple count() method #2749

maxio89 opened this issue Oct 29, 2023 · 5 comments · Fixed by #2985
Assignees
Labels
status: waiting-for-triage An issue we've not yet triaged

Comments

@maxio89
Copy link

maxio89 commented Oct 29, 2023

Is there a way to send a CountRequest without having an entity and repository?
What if I want to count number of documents in some index when having only index name?

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Oct 29, 2023
@sothawo
Copy link
Collaborator

sothawo commented Oct 31, 2023

The ReactiveElasticsearchClient does not have all the methods that it's imperative counterpart from the Elasticsearch library has. It has basically the methods that were needed to implement the current functionality of Spring Data Elasticsearch.

You can for example use the following code to get the number of entries in an index by using ReactiveElasticsearchOperations:

operations.count(operations.matchAllQuery(), Void.class, IndexCoordinates.of("index-name"));

Or you could add the count method by contributing with a PR.

@sothawo sothawo added the status: waiting-for-feedback We need additional information before we can continue label Oct 31, 2023
@spring-projects-issues
Copy link

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

@spring-projects-issues spring-projects-issues added the status: feedback-reminder We've sent a reminder that we need additional information before we can continue label Nov 7, 2023
@spring-projects-issues
Copy link

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.

@spring-projects-issues spring-projects-issues closed this as not planned Won't fix, can't repro, duplicate, stale Nov 14, 2023
@spring-projects-issues spring-projects-issues removed status: waiting-for-feedback We need additional information before we can continue status: feedback-reminder We've sent a reminder that we need additional information before we can continue status: waiting-for-triage An issue we've not yet triaged labels Nov 14, 2023
@maryantocinn
Copy link
Contributor

Hi @sothawo, I noticed the count() method is still not implemented yet, and was wondering if it’s still needed. If so, I’d be happy to contribute.

@sothawo
Copy link
Collaborator

sothawo commented Oct 11, 2024

Feel free to implement this, I think this should be 2 methods then, public Mono<CountResponse> count(CountRequest request) and the variant taking a Function<CountRequest.Builder, ObjectBuilder<CountRequest>> fn as parameter.

@sothawo sothawo reopened this Oct 11, 2024
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Oct 11, 2024
maryantocinn added a commit to maryantocinn/spring-data-elasticsearch that referenced this issue Oct 11, 2024
Add count methods using CountRequest with just ELC's ReactiveElasticsearchClient, without having to initialize any entity or repository. Also, refactored existing doCount method from ELC's ReactiveElasticsearchTemplate to use the newly created count method.

Closes spring-projects#2749
maryantocinn added a commit to maryantocinn/spring-data-elasticsearch that referenced this issue Oct 11, 2024
Implemented count methods using CountRequest directly with ELC's ReactiveElasticsearchClient, eliminating the need to initialize any entity or repository.
Refactored the existing doCount method in ReactiveElasticsearchTemplate to utilize the newly added count method.

Closes spring-projects#2749
maryantocinn added a commit to maryantocinn/spring-data-elasticsearch that referenced this issue Oct 11, 2024
Implemented count methods using CountRequest directly with ELC's ReactiveElasticsearchClient, eliminating the need to initialize any entity or repository.
Refactored the existing doCount method in ReactiveElasticsearchTemplate to utilize the newly added count method.

Closes spring-projects#2749
maryantocinn added a commit to maryantocinn/spring-data-elasticsearch that referenced this issue Oct 16, 2024
Implemented count methods using CountRequest directly with ELC's ReactiveElasticsearchClient, eliminating the need to initialize any entity or repository.

Closes spring-projects#2749
maryantocinn added a commit to maryantocinn/spring-data-elasticsearch that referenced this issue Oct 16, 2024
Implemented count methods using CountRequest directly with ELC's ReactiveElasticsearchClient, eliminating the need to initialize any entity or repository.

Closes spring-projects#2749
maryantocinn added a commit to maryantocinn/spring-data-elasticsearch that referenced this issue Oct 16, 2024
Implemented count methods using CountRequest directly with ELC's ReactiveElasticsearchClient, eliminating the need to initialize any entity or repository.

Closes spring-projects#2749
sothawo pushed a commit that referenced this issue Oct 17, 2024
@sothawo sothawo added this to the 5.4 RC1 (2024.1.0) milestone Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants