Laravel Scout Driver

composer require opensolr/laravel-scout-opensolr

Opensolr as your Laravel Scout engine

laravel-scout-opensolr is a Laravel Scout engine for Opensolr. Every Searchable model gets search by words and meaning together through the standard Model::search(), and one Opensolr Index serves all your models.

Install and set up

composer require opensolr/laravel-scout-opensolr
SCOUT_DRIVER=opensolr
OPENSOLR_EMAIL=you@example.com
OPENSOLR_API_KEY=your-api-key
OPENSOLR_INDEX=my_index
Post::search('how do keyword and meaning search combine?')->get();
Post::search('budget dining')->where('category', 'restaurants')->paginate(15);

Create the index first in the Control Panel, on a server with site search: What your index needs.

What you get

  • Hybrid search by default, with alpha for the balance in config/scout-opensolr.php.
  • where() and whereIn() as filters, with comparison operators, and pagination with real totals.
  • Documents kept apart per model automatically, so one index covers the whole application.
  • OpensolrClient::imageToWords(): a photo read into words you can search with.
  • aiAnswer(): a grounded answer written from the best documents. No LLM key needed.
  • A keyword-only mode that uses none of your AI allowance.

Links

Integration pages