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

Email/Query calculate total #3730

Open
remk opened this issue Sep 1, 2020 · 1 comment
Open

Email/Query calculate total #3730

remk opened this issue Sep 1, 2020 · 1 comment

Comments

@remk
Copy link
Member

remk commented Sep 1, 2020

###WHY
As a client i want to be able to calculate the total of mail returned by the query (ignoring pagination)

calculateTotal: Boolean (default: false) Does the client wish to know the total number of results in the query? This may be slow and expensive for servers to calculate, particularly with complex filters, so clients should take care to only request the total when needed.

request :

[[ "Email/query",{
  "accountId": "ue150411c",
  "calculateTotal": true,
  "filter":  {
     "minSize":  512
}
}, "0" ]]

response :

[[ "Email/query", {
  "accountId": "ue150411c",
  "total": 115,
  "ids": [ "Ma783e5cdf5f2deffbc97930a",
    "M9bd17497e2a99cb345fc1d0a", ... ]
}, "0" ]]

HOW

  • accept a 'calculateTotal' parameter in the request. If true calculate the total number of results for the query.
  • add a 'total' field in the response indicating the total number of results for the query.

DOD

  • write an integration test validating the calculation of the total and the response to the client for both a simple and a complex query
@chibenwa
Copy link
Member

chibenwa commented Sep 3, 2020

What are the Mailbox level API changes required to support "calculate total" ? What is the implementation strategy with ElasticSearch?

@chibenwa chibenwa added this to the Sprint 2 milestone Sep 3, 2020
@chibenwa chibenwa removed this from the Sprint 1 milestone Sep 30, 2020
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

No branches or pull requests

2 participants