I'm trying to create an or query with 2 related fields and 1 title field. My version so far is this:
$searchQuery->where([
'or',
['relatedTo', 'targetElement' => $ids, 'field' => 'field1'],
['relatedTo', 'targetElement' => $ids, 'field' => 'field2'],
['like', 'title', $search]
]);
But with that query I keep getting the error:
Undefined array key 0
$ids is not empty.
Any suggestions?