Change regex for resource search
We should change the regex used to find resources as follows. Instead of just filling in the search term into the regex, we should check every word (separated by space) with its own regex.
Example for /users
:
where={"$and":[
{"$or":[
{"firstname":{"$regex":"^(?i).*(keyword1).*"}},
{"lastname":{"$regex":"^(?i).*(keyword1).*"}},
{"nethz":{"$regex":"^(?i).*(keyword1).*"}},
]},
{"$or":[
{"firstname":{"$regex":"^(?i).*(keyword2).*"}},
{"lastname":{"$regex":"^(?i).*(keyword2).*"}},
{"nethz":{"$regex":"^(?i).*(keyword2).*"}},
]},
]}
This allows to search for multiple keywords such as firstname and lastname (e.g. Hans Muster
).