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

_rollup_search returns a 400 error when the body is empty-ish #32256

Closed
cjcenizal opened this issue Jul 20, 2018 · 1 comment
Closed

_rollup_search returns a 400 error when the body is empty-ish #32256

cjcenizal opened this issue Jul 20, 2018 · 1 comment
Assignees
Labels
>bug :StorageEngine/Rollup Turn fine-grained time-based data into coarser-grained data

Comments

@cjcenizal
Copy link
Contributor

CC @polyfractal @jen-huang

This request:

GET test_rollup_index/_rollup_search
{ "size": 0, "aggregations": {} }

Gets this response:

{
  "error": {
    "root_cause": [
      {
        "type": "action_request_validation_exception",
        "reason": "Validation Failed: 1: no requests added;"
      }
    ],
    "type": "action_request_validation_exception",
    "reason": "Validation Failed: 1: no requests added;"
  },
  "status": 400
}

Would it make sense to expect a similar response to this request? Just an idea. If not, then I think I'd prefer an empty result or barring that a helpful error.

GET test_rollup_index/_search
{ "size": 0, "aggregations": {} }

{
  "took": 0,
  "timed_out": false,
  "_shards": {
    "total": 1,
    "successful": 1,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
    "total": 308,
    "max_score": 0,
    "hits": []
  }
}
@cjcenizal cjcenizal added >bug :StorageEngine/Rollup Turn fine-grained time-based data into coarser-grained data labels Jul 20, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search-aggs

@polyfractal polyfractal self-assigned this Jul 25, 2018
polyfractal added a commit to polyfractal/elasticsearch that referenced this issue Aug 10, 2018
If a search request doesn't contain aggs (or an empty agg object),
we should just retun an empty response.  This is how the normal search
API works if you specify zero hits and empty aggs.

The existing behavior throws an exception because it tries to send
an empty msearch.

Closes elastic#32256
polyfractal added a commit that referenced this issue Aug 23, 2018
If a search request doesn't contain aggs (or an empty agg object),
we should just retun an empty response.  This is how the normal search
API works if you specify zero hits and empty aggs.

The existing behavior throws an exception because it tries to send
an empty msearch.

Closes #32256
polyfractal added a commit that referenced this issue Aug 23, 2018
If a search request doesn't contain aggs (or an empty agg object),
we should just retun an empty response.  This is how the normal search
API works if you specify zero hits and empty aggs.

The existing behavior throws an exception because it tries to send
an empty msearch.

Closes #32256
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :StorageEngine/Rollup Turn fine-grained time-based data into coarser-grained data
Projects
None yet
Development

No branches or pull requests

3 participants