Elasticsearch give me parsing error : 400

"error": "[400] {"error":{"root_cause":[{"type":"parsing_exception","reason":"no [query] registered for [filtered]","line":1,"col":35}],"type":"parsing_exception","reason":"no [query] registered for [filtered]","line":1,"col":35},"status":400}",
"status": "Fail"

I am new with ruby on rails, my ruby version is 2.3.1 and rails version is 4.2.4 as I am deploying my code in local system (development mode), everything work properly except elasticsearch.

I have install and try to mapping version of elasticserach 2.4.6, 5.0.0, 5.0.2 and also 5.6.3 but still I am getting above error in (postman) when I am passing my below query.

def build_query
ret = {
query: {
filtered: {
query: {
bool: { must: [] }
filter: { bool: { must: [] } },
post_filter: { bool: { must: [] } },
sort: {
FieldLong: {
order: "desc",
missing: "_last",
ignore_unmapped: true

Are you executing this query against Elasticsearch 5 or 6? The filtered query was deprecated in version 2 of Elasticsearch, and does not exist in version 5 and later anymore. You will get this error if you try to use that query on version 5 or later.

Instead, use a bool query. The documentation has an example on how to do that.

Thank you for your nice response can you please tell me how to configure elasticsearch 2.0 version in my gem file as well as configure for rails 4.2.4

Best to create a new topic for that, as I'm not familiar with Rails.

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