I’m a bit stuck with and app search regex query for
"elastic/enterprise-search": "^8.4",
{
"query": {
"bool": {
"must": {
"regexp": {
"url": {
"value": ".*surgery.*",
"flags": "ALL"
}
}
},
"filter": {
"term": {
"content_type": "standard_page_template"
}
}
}
}
}
this returns results fine
however
{
"query": {
"bool": {
"must": {
"regexp": {
"url": {
"value": ".*oesophageal-cancer/treatment/surgery.*",
"flags": "ALL"
}
}
},
"filter": {
"term": {
"content_type": "standard_page_template"
}
}
}
}
}
doesn’t. I’ve tried wrapping
(oesophageal-cancer/treatment/surgery)
and even escaping the hyphen and slash
I feel like this is something simple that I’m missing but can’t find direction anywhere (edited)
this is the PHP code using 8.4 of elastic/enterprise-search
$path_two = "(advanced-treatment/stents)";
$searchParams->query = [
'bool' => [
'must' => [
'regexp' => [
'url' => [
'value' => '.*' . $path_two,
],
],
],
'filter' => [
'term' => [
'content_type' => 'standard_page_template',
],
],
],
];
Many thanks, Andrew