In ElasticSearch stored documents, where in field "kitten" stored values of 2 types: words with numbers and only numbers. Example:
cat8389
fox973
947384
I want to get all documents, where in this array stored minimum one only numbers value, and can't write a correct query for it :(
I try this, but it's incorrect:
{
"query": {
"bool": {
"must": [
{
"regexp": {
"kitten": "[0-9 ]+$"
}
}
],
"must_not": [],
"should": []
}
},
"from": 0,
"size": 10,
"sort": [],
"aggs": {}
}
Help me, please...
$. The pattern must match the whole input. What do you mean by "minimum one only numbers value"? If you want to match digit-only fields,use"[0-9]+"