Hi Ingo,
thanks for checking up on this.
Maybe I'm getting things wrong, but I think there is no other way of doing it with the new ORM (or at least no documented way).
I just checked up with the following example. Let's say I'm searching for "$query = New York", and there is a dataobject with a City attribute that has the value "New York". This code returns nothing:
$projects = $projects->filter(array(
'Title:PartialMatch' => $query,
'City:PartialMatch' => $query,
));
If I'm uncommenting the Title part, I'm getting the dataobject with the city "New York", which leads me to conclude that this is an AND statement.
What I was looking for was an OR statement, which I believe the previous example would have given.
Maybe I'm missing something?
I got around it using the "where" method. Here is how I did for a small search functioniality:
$query = strtolower(addslashes($query));
$qarr = preg_split('/[ +]/', $query);
$filter = '';
$first = true;
foreach ($qarr as $qitem) {
if (!$first) {
$filter .= " AND ";
}
$filter .= " (
Title LIKE '%$qitem%'
OR City LIKE '%$qitem%'
)";
$first = false;
}
$projects = $projects->where($filter);
Again, forgive me if I should have missed something obvious in the documentation, but I believe there might be no way of writing OR statements with the partialmatch filter.
Anselm