ES fails with no [query] registered for [filtered]

Elasticsearch fails with

[{"type":"parsing_exception","reason":"no [query] registered for [filtered]"

{
  query: {
    filtered: {
      filter: {
        bool: {
          must:     must_terms,
          must_not: must_not_terms,
          should:   should_terms,
        },
      },
    },
  },
  aggs: aggregation,
  sort: sort,
  size: amount_of_results,
}

How can I rewrite the query according to ES 5.0+ updates?
I know filtered is deprecated, but I cannot seem to make it work.

I tried changing the query to:

{
  query: {
    bool: {
      must:     must_terms,
      must_not: must_not_terms,
      should:   should_terms,
    },
  },
  aggs: aggregation,
  sort: sort,
  size: amount_of_results,
}

But now the query doesn't yield any result.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.