Hello
I'm using 'search' api of elasticsearch (7.4.1) and the following is the query I pass to this api :
`["size" => 10000,
"query" => [
"bool" => [
"must" => [
[
"regexp" => [
"name" => [
"value" => "carrier.*",
"flags" => "ALL"
]
]
],
[
"term" => [
"countryId" => 1
]
],
[
"term" => [
"active" => 1
]
]
]
]
]
];`
What I expect is to search all documents that their 'name' field starts with 'carrier' but I get all documents that their 'name' field includes 'carrier' word even if it is in the middle, for example all of the following values are matched :
'test carrier'
'carrier'
'carrier 1'
But I expect to match just 'carrier' and 'carrier 1' not 'test carrier'. (The 'countryId' and 'active' terms work perfectly)
I've searched alot and couldn't find the reason for this. I've also tried to use other methods like 'wildcard', 'prefix', .... and no difference. Would you please let me know if I'm missing anything ?
Thanks in advance for your help