-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Add document _count API support to Rest High Level Client. #31868
Conversation
At the moment there are no CountRequest and CountResponse classes, and RestCountAction will return SearchResponse with XContent generated dynamically (inline). CountRequest and CountResponse are added to HL Rest Client. CountRequest aggregates SearchRequest and exposes relevant methods to user of CountRequest, and delegates these to the counterparts in SearchRequest. CountResponse, on the contrary has no relationship with SearchResponse, instead CountResponse will reuese relevant members (SearchShardFailures).
Pinging @elastic/es-core-infra |
Oh my im quite sorry, this slipped thru my email filter. Ill be looking at it tomorrow. Sorry @mrdjen !!! |
@mrdjen This is more of a generalized question, so im not going to leave it on the review. Ive decided to wait for a more thorough review until we've sorted this out. It looks like the |
Hey thanks for response @hub-cap , and no worries about delay, contributors guide says "sit back and wait" :) Yes its possible to use
So in this context I added |
Ok, I went ahead and had a conversation with some members on the team that have some prior knowledge about the count API. So a while back we decided to remove the count API from being a TransportAction, since it did / does not need to be. Its effectively a search, like you said, but without the ability to set some things. After looking at the PR, it would make more sense if we created an actual valid count request/response that is not only used by the client, but that is also used by the server. You gave some good reasons to do so above. So, if you would like to take it on, you can separate this into 2 PRs. The first PR should be the count request/response classes, and using them in the I dont think that its a huge undertaking to put the count request/response into server, and get them used in the What do you think? Edit: Thanks for your patience. |
Thanks for response @hub-cap , yes I can create another PR with count request/response classes and use them in Asking from the top of my head - apart from moving these to server (and then using them in |
Id say start out leaving them separate and see how different they end up looking. If after an iteration or two it looks like its similar enough, we can talk about just using a <3 for the contribution! |
…RestCountAction (cat and doc). At the moment there are no CountRequest and CountResponse classes, and RestCountAction will return SearchResponse with XContent generated dynamically (inline), this PR adds CountRequest and CountResponse. During review of elastic#31868 it was decided to separate elastic#31868 into two PRs and this is first part.
@mrdjen we can close this right? |
Right, closing it now @hub-cap |
At the moment there are no CountRequest and CountResponse classes, and RestCountAction will return SearchResponse with XContent generated dynamically (inline).
CountRequest and CountResponse are added to HL Rest Client.
CountRequest aggregates SearchRequest and exposes relevant methods to user of CountRequest, and delegates these to the counterparts in SearchRequest.
CountResponse, on the contrary has no relationship with SearchResponse, instead CountResponse will reuese relevant members (SearchShardFailures).
Relates to #27205
@javanna