-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Open
Labels
:Search Relevance/ES|QLSearch functionality in ES|QLSearch functionality in ES|QL:SearchOrg/RelevanceLabel for the Search (solution/org) Relevance teamLabel for the Search (solution/org) Relevance team>bugTeam:Search - RelevanceThe Search organization Search Relevance teamThe Search organization Search Relevance teamTeam:Search RelevanceMeta label for the Search Relevance team in ElasticsearchMeta label for the Search Relevance team in ElasticsearchTeam:SearchOrgMeta label for the Search Org (Enterprise Search)Meta label for the Search Org (Enterprise Search)priority:normalA label for assessing bug priority to be used by ES engineersA label for assessing bug priority to be used by ES engineers
Description
Elasticsearch Version
9.2
Installed Plugins
No response
Java Version
bundled
OS Version
Darwin Kernel Version 24.3.0
Problem Description
Currently we're checking that origin
and scale
have a suitable type with regards to the value
parameter, but we do not check this for offset
. So in theory someone could specify a temporal offset
for a numeric decay, which will lead to a class cast exception somewhere down in the evaluator code.
Steps to Reproduce
POST {{ES_HOST}}/_query?format=txt
{
"query": "ROW value = 10, origin = 10, scale = 10 | EVAL score = decay(value, origin, scale, {\"offset\": \"10km\"})"
}
Error:
{
"error": {
"root_cause": [
{
"type": "class_cast_exception",
"reason": "class org.apache.lucene.util.BytesRef cannot be cast to class java.lang.Integer (org.apache.lucene.util.BytesRef is in module [email protected] of loader 'app'; java.lang.Integer is in module java.base of loader 'bootstrap')"
}
],
"type": "class_cast_exception",
"reason": "class org.apache.lucene.util.BytesRef cannot be cast to class java.lang.Integer (org.apache.lucene.util.BytesRef is in module [email protected] of loader 'app'; java.lang.Integer is in module java.base of loader 'bootstrap')"
},
"status": 500
}
Expected behavior: clear type error message that offset
needs to be an integer
instead of a raw class cast exception
Logs (if relevant)
No response
Metadata
Metadata
Assignees
Labels
:Search Relevance/ES|QLSearch functionality in ES|QLSearch functionality in ES|QL:SearchOrg/RelevanceLabel for the Search (solution/org) Relevance teamLabel for the Search (solution/org) Relevance team>bugTeam:Search - RelevanceThe Search organization Search Relevance teamThe Search organization Search Relevance teamTeam:Search RelevanceMeta label for the Search Relevance team in ElasticsearchMeta label for the Search Relevance team in ElasticsearchTeam:SearchOrgMeta label for the Search Org (Enterprise Search)Meta label for the Search Org (Enterprise Search)priority:normalA label for assessing bug priority to be used by ES engineersA label for assessing bug priority to be used by ES engineers