Hi,
I’ve been trying to search by regex but I can’t figure out how to use it exactly?
I created an index having a field title
and this is the configuration of the index and title
field.
{
"mappings": {
"dynamic": false,
"fields": {
"_id": {
"type": "objectId"
}
"title": {
"type": "string"
}
}
}
}
For example, the value title
is Jon test shared?
At the moment, my current query return nothing.
$search: {
index: "default",
regex: {
query: "(.*)jon test(.*)",
path: "title",
allowAnalyzedField: true
}
}
Atlas search even through error when I was trying to search a special character.
$search: {
index: "default",
regex: {
query: "(.*)shared\?(.*)",
path: "title",
allowAnalyzedField: true
}
}
—> Failed to run this query. Invalid pipeline