sirensolutions / siren-join

[This is the old, single node version for Elasticsearch 2.x, see the latest "Siren Federate" plugin for distributed Elasticsearch 5.x and 6.x capabilities]
http://siren.io
GNU Affero General Public License v3.0
183 stars 60 forks source link

FieldDataTermsQueryParser dumps the byte array in the log if a query parsing exception occurs #101

Closed rendel closed 8 years ago

rendel commented 8 years ago

This can occur for example if an index pattern (or list of indices) is given as part of the request, but one of the index does not have the queried field. In this scenario, the shard throws a QueryParsingException, and the query is serialised into the log. However, the query should not serialise the byte array.

rendel commented 8 years ago

The SearchService, in case of an exception, is serialising the request's source and log it along with the error message. Unfortunately, this is elasticsearch code and we can't modify the logic. However, the field data terms query parser should not throw an exception if a field does not exist, instead it should consider this valid and return an empty result set. This will partially solve the issue as we will not dump anymore the byte array whenever a field does not exist. The byte array will be serialised and dumped in the log only if there is an invalid query syntax (e.g., one query parameter missing).