Each document consists of "name, city and branch" then they also contain "keywords" which is a combines version of "name, city and branch".
I now need a regular expression, this is what I got:
public function searchLocation($keyword){
$result = $this->locations->find(array('keywords' => new MongoRegex('/^' . strtolower($keyword) . '/')));
if($result){
return $result;
}
return false;
}
Problem is, that when the user input was "grandcaffee london" it won't search for EACH word, or when the user inserts: "Cinema New York".
Thanks for reading.