"Failed to derive xcontent" - elasticsearch-ruby/dsl


(Jay Snee) #1

Hello!

I'm getting the following error when attempting to a run a query from a Rails app -

2016-12-12T17:33:08.461564758Z app[web.4]: --> GET my-lovely-index/_search {} {"aggregations":{"items":{"nested":{"path":"items"},"aggregations":{"name":{"terms":{"field":"items.name","size":1000000}}}}}}
2016-12-12T17:33:09.959661891Z app[web.4]: --> RESPONSE {"error":{"root_cause":[{"type":"parse_exception","reason":"Failed to derive xcontent"}],"type":"parse_exception","reason":"Failed to derive xcontent"},"status":400}

I can copy the query from the logs and run it via the Dev Console/Sense and it runs fine.

I've tried:

  • Removing the size param
  • bundle update => redeploy
  • App server update/bounce
  • Cluster reprovisioning/memory increase

The ES Ruby DSL code looks like:

query_definition = search do
  aggregation :items do
    nested do
      path nested_fields
      aggregation :name do
        terms do
          field field_name
        end
      end
    end
  end
end

terms_response = client.search index: index, body: query_definition.to_json

Cluster in question is: a49768

Any clues as to where I've gone wrong are appreciated, thanks! :slight_smile:


(Christian Strzadala) #2

Hi @jay-snee,

As this seems to be a Elasticsearch Ruby DSL issue, I can't help you directly with this from the cloud channel. I'll move this to the Elasticsearch channel where users of the Ruby DSL may be able to help you there.

Christian


(system) #3

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