multiSearch - How to Exclude Records from Search
Hi All -
Is there a way to exclude selected records from a multiSearch? There are often certain pages on my sites which shouldn't be viewed unless the user first comes from another page. The search gives them direct access in a way that should be possible by normal means.
I understand there isn't a "where" function in multiSearch - so I wondered if there was any other way I can make it skip records flagged with a particular value?
One way you can exclude records from the multiSearch would be to use the "hidden" checkbox on the record. The record would then not appear in the search results.
To be able to link to the record directly and it have it display (even when marked as hidden) would require that you add the following to the View Options:
'ignoreHidden' => true, // don't hide records with hidden flag set
Hope this helps. If you need any additional details about the steps or have questions, just let me know.
Damon Edis - interactivetools.com
Hire me! Save time by getting our experts to help with your project.
Hi, Damon -
Thanks for your input. Unfortunately the "hidden" option is already factored into this set-up. There are some records which are hidden on the site - which multiSearch will not find. Then there are some records which are visible but which I want to exclude from multiSearch.
For example this could include a "Thank you" page after a user has filled in a form. It's not hidden - I just don't want the search to find it!