Laravel Scout Adds Typesense, A Lightening-fast Open-source Search
Last updated on by Paul Redmond
A recent Laravel Scout release added Typesense, a lightening-fast open-source search alternative to Algolia + Pinecone:
Typesense is a modern, privacy-friendly, open-source search engine meticulously engineered for performance & ease-of-use.
It uses cutting-edge search algorithms that take advantage of the latest advances in Hardware Capabilities & Machine Learning.
What’s neat about Typesense is that you can install and run it as part of your local development environment using a Linux package or Docker on macOS and Windows platforms. See the Local Machine / Self-Hosting documentation for instructions on running Typesense.
On the Laravel Scout side, the Scout documentation includes instructions for configuring Typesense for Scout. Here’s an example of using Typesense to modify search parameters dynamically using the Scout model search:
use App\Models\Todo; Todo::search('Groceries')->withSearchParameters([ 'query_by' => 'title, description'])->get();
This feature was released with Laravel Scout Release v10.7.0. You can learn more about the integration in Pull Request #773.
More generally, you can use Typesense with the typesense/typesense-php composer package, which Scout requires to interact with the Typesense search API. The Typesense documentation (especially the guide) is an excellent place to start to learn more about how to get started with Typesense.