Meilisearch Commands Overview
Meilisearch commands manage the search indexing system for FVN.li. These commands handle initial setup, maintenance reindexing, and index configuration.
Available Commands
meilisearch:setup - Set up Meilisearch indexes and migrate data from PostgreSQL search
meilisearch:reindex - Reindex content in Meilisearch for maintenance (normal operations use automatic indexing)
scout:sync-index-settings - Sync your configured index settings with your search engine
When to Use
Initial Setup
Use meilisearch:setup when:
Setting up a new environment
Migrating from PostgreSQL full-text search to Meilisearch
Rebuilding indexes from scratch
Maintenance
Use meilisearch:reindex when:
Search results seem outdated or incorrect
After making changes to index configuration
Recovering from index corruption
Performing periodic maintenance
Configuration Updates
Use scout:sync-index-settings when:
Updating searchable attributes
Changing filterable or sortable fields
Modifying ranking rules
Updating stop words or synonyms
Automatic Indexing
Important: Normal operations use automatic indexing via Eloquent observers. Manual reindexing is only needed for:
Initial setup
Maintenance and troubleshooting
Configuration changes
Bulk data migrations
The following operations trigger automatic indexing:
Creating new games
Updating game information
Adding or updating dialogue texts
Creating or updating reviews
Modifying tags
Search Indexes
FVN.li maintains the following Meilisearch indexes:
Games Index
Primary Key:
idSearchable Fields: title, description, author
Filterable Fields: tags, languages, platforms, content_flags, rating, release_date
Sortable Fields: rating, release_date, created_at
Dialogue Index
Primary Key:
idSearchable Fields: text, character_name
Filterable Fields: game_id, language, character_id
Sortable Fields: created_at
Reviews Index
Primary Key:
idSearchable Fields: content, title
Filterable Fields: game_id, rating, user_id
Sortable Fields: rating, created_at
Tags Index
Primary Key:
idSearchable Fields: name, description
Filterable Fields: category, usage_count
Sortable Fields: usage_count, name
Performance Considerations
Index Size
Games: ~10,000 documents
Dialogue: ~1,000,000+ documents
Reviews: ~50,000 documents
Tags: ~500 documents
Reindexing Time
Full reindex: 5-15 minutes depending on data volume
Partial reindex: 1-5 minutes
Individual updates: Near-instant via observers
Resource Usage
Meilisearch uses RAM for indexing
Ensure adequate memory during reindexing
Consider running during low-traffic periods
Troubleshooting
Connection Issues
If you see "Cannot connect to Meilisearch":
Check that Meilisearch is running:
ddev describeVerify the
MEILISEARCH_HOSTin.envCheck Meilisearch logs:
ddev logs -s meilisearch
Slow Search
If search is slow:
Check index health
Verify filterable/sortable fields are properly configured
Consider reducing searchable fields
Check Meilisearch resource allocation
Missing Results
If search results are missing:
Run
meilisearch:reindexto rebuild indexesCheck that automatic indexing is working
Verify model observers are registered
Check Meilisearch logs for errors
Best Practices
Initial Setup: Always run
meilisearch:setupon new environmentsConfiguration Changes: Run
scout:sync-index-settingsafter modifying search configurationMaintenance: Schedule periodic reindexing (monthly or quarterly)
Monitoring: Monitor search performance and index health
Backups: Meilisearch data is derived from PostgreSQL, so database backups are sufficient
Related Documentation
SearchIndexService - Service handling search operations