Hi,
So I'm having a hard time getting my anchored regex to work the way I want on my array of tags (I disabled analyzing)
{
"doc": {
"mappings": {
"info": {
"properties": {
"tags": {
"type": "string",
"index": "not_analyzed"
},
"query": {
"properties": {
"regexp": {
"properties": {
"tags": {
"type": "string",
"index": "not_analyzed"
}
}
}
}
}
}
}
}
Querying the tags without anchor works fine and returns what I expect which is all tags matching .linux.
GET /doc/info/_validate/query?explain
{
"query": {
"regexp": {
"tags": ".*linux.*"
}
}
}
But say I have a tag "linux_x86" and a tag "linux", I need to anchor my regex to return only an exact match on ^linux$
GET /doc/info/_validate/query?explain
{
"query": {
"regexp": {
"tags": "^linux$"
}
}
}
Which doesn't work (returns empty) on array of strings, the explain isn't really explicit about what it's doing, I'm guessing it's looking for an exact anchored match across all tags instead of anchored match per tag in the array...
Hopefully someone could explain why and help me finding a workaround
Thanks