Open mumutu66 opened 1 year ago
@mumutu66 can you provide a reproduceable set of steps that show the behavior you mentioned?
Pinging @elastic/es-search (Team:Search)
sorry for the late reply, the case is simple if a index has a mapping field with type long,when term query with case_insensitive will got error
in following example check_user_id
is a long
type
{
"query": {
"constant_score": {
"filter": {
"bool": {
"must": [
{
"term": {
"check_user_id": {
"value": 123123,
"case_insensitive": true
}
}
},
{
"exists": {
"field": "create_time"
}
}
]
}
}
}
},
"_source": false,
"size": 0,
"stored_fields": "_none_",
"track_total_hits": true
}
then I got a error
"reason": "[check_user_id] field which is of type [long], does not support case insensitive term queries",
I know this option case_insensitive
is not suitable for a long type field, but I prefer a warning instead of error..or some hint to change some option in es to avoid the failure
Pinging @elastic/es-search-relevance (Team:Search Relevance)
Description
In my case term search with a keyword with case_insensitive key is ok, but if the field switch to a long or anything else except keyword, I got an error
case_insensitive
is not supported and the query is failed. if an option to turn this exception to a warning is really useful for some general template query case, which can avoid to change the code with the field type changed