Skip to content

Aurora 1.0 is out!

What's new →
Docs menu

Building a site

Search

Search live pages with Laravel Scout, per site and language.

The engine

Pages are indexed with Laravel Scout: title, summary, SEO fields and the text of every block, per language. Without a search service, Aurora's database engine is used: MySQL and MariaDB get full-text search with relevance, and other databases a simple match. Any Scout driver works too: set SCOUT_DRIVER to meilisearch, typesense or algolia, then import.

On the website

Page::search() searches the live pages anyone may see on the site the visitor is on, worked out from the address, most relevant first:

PHP
use Aurora\Models\Page;

$results = Page::search('fjord')->paginate(10);

// Add to it as with any Scout search: the limits stay.
Page::search('fjord')->query(fn ($query) => $query->with('author'))->get();

// Another site's pages, named.
Page::searchSite('fjord', site: $site)->get();

Chaining ->query() adds eager loading without lifting the limits: drafts and other sites' pages never come back.

In the admin

Settings › Search & SEO tries searches and reindexes, and each page shows what the index holds for it. People who manage search can leave a page out. The REST and GraphQL APIs offer the same search.

Search and SEO settings: a search to try against the index, with the pages it finds
Settings › Search & SEO: try a search and see what the index finds.