How to find numbers starting with 80?

Hi,

Kibana Discover option. I'd like to display all docs that has filed value (number) starting with 20.
Possible to do this?
In SQL it would be ...WHERE field1 LIKE '20%'
How to do this in Kibana?
Regards

You can make use of the "regexp" option. It will apply the regexp to the terms.

GET <index_name>/_search
{
"query": {
"regexp":{
"field_name": "20
"
}
}
}

Good, thank you very much. But how to do this in Kibana menu? Query syntax is too complex for ordinary user - they use GUI.

I'm not sure but I donc think that LIKE operation is possible on number. You can use range instead. LIKE is only for text fields

Thanks but looks like range will give me nothing; I'd like to find with article number starting with 80 not greater or smaller than 80. Hard to believe such basic operator does not exists in Elastic :frowning:

You can use a regex query, but that requires the field to be mapped as keyword, not a number.

Thanks. Maybe you can add this to the wishlist? Looks like basic function....

If it is not a field you will be doing mathematical operations on, e.g. a phone number or a numeric article id, you should send it as a string and map it as keyword.

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