Updated August 10, 2026
Basic Usage
The most straightforward way to search is using the search method. SearchJet automatically searches through Gutenberg block content and returns ranked results.
Performing a Simple Search
Use the SearchJet facade to run a search query. The search method accepts a query string and returns an array of matching results sorted by relevance.
use SearchJet\SearchJet;
$results = SearchJet::search('laravel');
foreach ($results['hits'] as $hit) {
echo $hit['title'];
echo $hit['content'];
}
Adding Filters
Narrow results by adding filters. You can filter by any indexed field like category, tag, or custom field.
$results = SearchJet::search('framework')
->filter('category', 'tutorials')
->get();
Pagination
For large result sets, use pagination to limit results per page.
$results = SearchJet::search('wordpress')
->paginate(1, 20); // Page 1, 20 results per page
See the query builder guide for advanced search operations.