I want to get all 000ANT
and 0BBNTA
from id, is there something similar to terms which works with regexp or is there any other way? Otherwise I will have to query elasticsearch for each item say 000ANT and 0BBNTA. Please help.
Below is something that I am trying out for 1 i.e., 000ANT
but I also want to have a or condition so regex can also match 0BBNTA
.
GET dc/ma/_search
{
"fields": [
"host"
],
"filter": {
"bool": {
"must": [
{
"regexp": {
"_uid": {
"value": ".*000ANT.*"
}
}
}
]
}
}
}
Use a should
instead of a must
:
{
"fields": [
"host"
],
"filter": {
"bool": {
"should": [
{
"regexp": {
"_uid": {
"value": ".*000ANT.*"
}
}
},
{
"regexp": {
"_uid": {
"value": ".*0BBNTA.*"
}
}
}
]
}
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With