Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Search Bundle

Search Bundle Laravel Package

atoolo/search-bundle

The Atoolo Search Bundle provides services for populating and querying a Solr index, enabling search across resources from the Atoolo Resource Bundle. It integrates seamlessly with Symfony applications, offering a flexible foundation for building powerful, resource-based search experiences.

View on GitHub
Deep Wiki
Context7

Atoolo Search Bundle provides the services needed to populate a Solr index and search it for resources managed by the resources-bundle. It bridges indexed documents with the Atoolo resource model, so applications can index and query content consistently through a single, well-defined API.

Built for modern PHP (8.2–8.4) and validated with PHPStan level 9, the bundle integrates cleanly into Symfony-based projects and is covered by end-to-end tests.

  • Index resources into Solr via dedicated services
  • Search indexed resources with a clean API
  • Seamless integration with atoolo-resource-bundle
  • High code quality: PHPStan level 9, codecov coverage
  • Verified by E2E tests across supported PHP versions
Frequently asked questions about Search Bundle
What is atoolo/search-bundle used for?
It is a Symfony bundle that provides services for filling and searching an Apache Solr index with resources from atoolo/resource-bundle. In a Laravel application you would use it as the indexing and search layer for CMS content, products, or custom entities, gaining full-text search, faceting, spellcheck, and geospatial queries through Solr. It is not Laravel-native, so you should expect to bridge Symfony's dependency injection container yourself.
How do I install atoolo/search-bundle in a Laravel project?
Require the package with Composer alongside atoolo/resource-bundle v1.7 or later on PHP 8.1 to 8.4. Because it ships as a Symfony bundle, register its services through a Laravel service provider that loads the Symfony container via symfony/dependency-injection, or alias the key services such as the search client. You will also need a running Solr instance and a schema that matches the IndexSchema2xDocument fields, and you should confirm the exact version constraints in the repository's composer.json before committing.
Does atoolo/search-bundle work with Laravel 11 and PHP 8.4?
The bundle targets Symfony 6 and 7 and supports PHP 8.1 through 8.4, and Laravel 10, 11, and 12 run on compatible PHP versions, but there is no official Laravel integration package. You can wire it in through Laravel's service container and the Symfony DI bridge, then verify behavior in a staging environment. The README notes that PHP 8.1 is no longer checked automatically by CI, so PHP 8.2 or newer is the safer choice.
Do I need an Apache Solr server to use this package?
Yes. The bundle is designed around Apache Solr, whether self-hosted, SolrCloud, or a managed service, and it does not include an embedded search engine. You must provision Solr, define a schema for your document fields, and monitor cluster health during bulk indexing and peak traffic. Plan a fallback such as cached results or a database query for the case where Solr becomes unavailable.
Can I index asynchronously with Laravel queues using atoolo/search-bundle?
The bundle exposes CLI commands and services for filling the index and supports event-driven updates, so you can trigger indexing from Eloquent created, updated, and deleted events through listeners or queued jobs. Offloading indexing to Laravel queue workers keeps HTTP requests fast during large reindexes. Keep an eye on queue throughput and Solr load during peak periods, and consider batch runs for very large datasets.
How do I map Eloquent models to atoolo resources for indexing?
The bundle indexes atoolo/resource-bundle resources rather than Eloquent models directly, so you need to implement or extend resource types, or build DTOs, that represent your models. If your data model does not align with the provided resource interfaces, extend or mock them before handing resources to the indexer services and commands. Keeping that mapping layer thin makes schema changes in Solr easier to manage later.
Can I build faceted search endpoints in Laravel with this bundle?
Yes. Solr provides faceting, full-text matching, spellcheck, and geospatial queries, and the bundle's search services return results you can expose through Laravel routes, controllers, or API resources. The usual pattern is to wrap the search service in your own Laravel service and add middleware for authentication, authorization, and rate limiting. Validate the Solr schema against the document fields, such as sp_startletter and sp_sortvalue, before deploying to production.
Does atoolo/search-bundle support multi-language or locale-specific content?
Yes. Locale-specific indexing is supported, with locale handling noted in the changelog for version 1.13.0, so multi-language sites can index documents per locale. You still need to design Solr fields and query filters for language and pass the correct locale both when indexing and when searching. Check the project documentation for the exact parameter names used when updating documents with a locale.
How do I handle access control for protected resources in Solr?
The bundle supports authorization groups through include_groups, which lets you restrict results to resources a user is allowed to see. In Laravel you would map your roles or policies to those groups and inject them into each search query for the authenticated user. Always enforce authorization server-side in your controller or service, never only in the front end.
Is atoolo/search-bundle a good alternative to Laravel Scout or Meilisearch?
It solves a different problem. The bundle is a Symfony package tightly coupled to atoolo/resource-bundle and Apache Solr, whereas Laravel Scout offers first-party Eloquent integration with drivers such as Algolia, Meilisearch, or the database. Choose atoolo if you already run Solr and want advanced features like faceting, geospatial search, and spellcheck over atoolo resources; choose Scout for simpler Laravel-native setups. The bundle benefits from PHPStan level 9 analysis and end-to-end tests, but Laravel support is something you add yourself rather than an official feature.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console