etsy / 411

An Alert Management Web Application
https://demo.fouroneone.io
MIT License
971 stars 112 forks source link

Unable to create searches with ES 5.0 #84

Closed sam-dumont closed 7 years ago

sam-dumont commented 7 years ago

It seems that "filtered" is deprecated in ES5.0 and it's not possible to run a search against it with the current version of 411.

I receive this error : SearchException: parsing_exception: no [query] registered for [filtered]

[Sun Nov 13 14:40:54.367164 2016] [:error] [pid 12602] [client XXX] except [NONE] FOO\SearchException: "parsing_exception: no [query] registered for [filtered]" at [/var/www/411/phplib/Search/Elasticsearch.php:309] 0:[FOO\Elasticsearch_Search->search() called at [/var/www/411/phplib/Search/Elasticsearch.php:142]] 1:[FOO\Elasticsearch_Search->_execute() called at [/var/www/411/phplib/Search.php:221]] 2:[FOO\Search->execute() called at [/var/www/411/phplib/Job/Search.php:56]] 3:[FOO\Search_Job->_run() called at [/var/www/411/phplib/REST/Searches.php:153]] 4:[FOO\Searches_REST->test() called at [/var/www/411/phplib/REST/Searches.php:57]] 5:[FOO\Searches_REST->POST() called at [/var/www/411/phplib/REST.php:108]] 6:[FOO\REST->route() called at [/var/www/411/htdocs/api/searches.php:6]], referer: https://XXX/searches/new?type=logstash [Sun Nov 13 14:40:54.372254 2016] [:error] [pid 12602] [client XXX] err [JOB] Search error id:[] job_id:[] errors:[0:[SearchException: parsing_exception: no [query] registered for [filtered]]], referer: https://XXX/searches/new?type=logstash

kiwiz commented 7 years ago

This will be fun... I don't think we can do this without checking the version of the ES cluster.

sam-dumont commented 7 years ago

If you need testers, I will gladly help. I don't have too much time to dig into the code and modify it myself, but if you need specific tests, I'm currently using/building an ES 5 cluster at work and have a good dataset :)

kiwiz commented 7 years ago

According to https://github.com/elastic/elasticsearch-php#version-matrix, the 5.0 version of the library is not backwards compatible with 2.0. We're using 2.0 atm, so this is a dealbreaker as far as adding 5.0 support goes. Sorry!

missnebun commented 7 years ago

@kiwiz are you planing to add support at some point for ES 5?

kiwiz commented 7 years ago

@missnebun It would be next year at the earliest - no time to do this work right now.

sts commented 7 years ago

Looks like this is related to the following change:

https://www.elastic.co/guide/en/elasticsearch/reference/5.x/query-dsl-filtered-query.html https://github.com/etsy/411/blob/694dbb23ff7311cfaf706c98bf64afce8cd88e8a/phplib/ESClient.php

kiwiz commented 7 years ago

There's now (experimental) ES5.0 support. See #106 for details.