Created
August 22, 2014 14:09
-
-
Save bastianallgeier/b5c5d5f5dea1d2bbcb7b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// search the entire site | |
$results = $site->search('my awesome search'); | |
// search all children, children of children, etc. of the current page | |
$results = $page->search('my awesome search'); | |
// filter the search results | |
$results = $page->search('my awesome search')->visible()->filterBy('template', 'article'); | |
// add pagination to the search results | |
$results = $page->search('my awesome search')->paginate(20); | |
// search in certain fields only | |
$results = $page->search('my awesome search', 'title|text'); | |
// search for full words only | |
$results = $page->search('my awesome->search', array('words' => true)); | |
// feed the search with a get parameter -> http://yourdomain.com/?q=awesome | |
$results = $page->search(get('q')); | |
// and much more!! | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment