Search
JournalPHP implements full-text search via Laravel Scout.
How Search Works
Search uses Laravel Scout. The driver is set via SCOUT_DRIVER in .env:
| Driver | When to use |
|---|---|
null | Value in .env.example — search disabled until configured |
database | MySQL FULLTEXT with no external services (recommended for self-hosted) |
algolia / meilisearch | External search engine |
In config/scout.php, the default fallback is algolia if the variable is unset.
Scout indexes only two models: Post and User. Community and tag search runs separately, outside Scout.
What Gets Indexed
| Model | Indexed fields |
|---|---|
Post | title, blocks |
User | name |
Tag Search
Tags are not part of the Scout index. Tag search and navigation use dedicated routes:
- Tag page:
/tag/{slug} - Popular tags:
/tags/popular
Tag management — Admin Panel → Tags (/admin-panel/tags).
Re-Indexing
To rebuild the search index:
bash
# Re-index posts
docker compose exec app php artisan scout:import "App\Models\Post"
# Re-index users
docker compose exec app php artisan scout:import "App\Models\User"
# Clear index
docker compose exec app php artisan scout:flush "App\Models\Post"Search Page
Discovery and search: /discovery
| URL | Content |
|---|---|
/discovery | Search posts, users, and communities |
/discovery/blogs | Top blogs and authors |
/discovery/topics | Community directory |
/tag/{name} | Posts by tag |
Tags as Navigation
Tags are an additional content discovery mechanism. Each tag has its own page (/tag/{slug}) and is included in sitemap.xml for SEO.