Hi all,
I have a website that has Pages with text and Page fieldtypes. Is there an elegant way to search both of them (in this case, the Page titles of the referenced pages) at the same time for a search string?
Doing a search of the Page titles and bodies is easy enough:
$my_textual_results = $pages->find("body|title%=$query, sort=-posted, limit=10");
And of the referenced Pages, too:
$my_referenced_pages = $pages->get('/referenced-pages/')->find("title%=$query");
$my_referenced_results = $pages->find("referenced_pages=$my_referenced_pages, sort=-posted, limit=10");
Now how do I combine these two search queries into one? I tried an 'or' operator between the two different search parameters:
$my_referenced_pages = $pages->get("/referenced-pages/")->find("title%=$query");
$total_results = $pages->find("body|title%=$query | referenced_pages=$my_referenced_pages, sort=-posted, limit=10");
...but that didn't work.
Any ideas? Thanks!
-evan