rz/search-bundle
RZ Search Bundle adds flexible full-text search to PHP applications, with simple configuration and integration for indexing and querying your data.
This bundle is an archived Symfony 2-era extension of nelmio/solarium-bundle. Before writing any code, confirm your platform still matches:
composer.json for symfony/symfony and nelmio/solarium-bundle version bounds. On anything newer than Symfony 3.x / PHP 7.x you will hit solver conflicts. If you are on a modern stack, do not try to force it — vendor the few classes you actually need or use Solarium directly.nelmio/solarium-bundle, and then this bundle. The Nelmio bundle does the client/config plumbing (solarium.client service, config.yml endpoints and cores); rz/search-bundle layers search/index abstractions on top of that service.Resources/config/services.xml (what services it registers and what it decorates), the DependencyInjection/ extension and Configuration.php (the config tree you can set under rz_search:), then Annotation/ or Document/ (how indexable objects are declared), and finally any Command/ folder for reindex utilities. That tells you the intended entry point faster than the README.AppKernel::registerBundles() (Nelmio first, this one after), then expose the config:
# config.yml
nelmio_solarium:
endpoints:
default: { host: '%solr_host%', port: 8983, path: /solr }
clients:
default: { endpoints: [default] }
rz_search:
# options as declared in Configuration.php
Realistically: allocate a timebox to this. Because the package is archived with zero dependents, treat step 1 as a go/no-go decision rather than a formality.
The intended workflow is annotation/config-driven indexing over Solarium, so most day-to-day work happens in three places: your document classes, the indexer service, and thin controller/repository wrappers.
postPersist/postUpdate, or a message handler) rather than relying on lifecycle callbacks in the bundle. Explicit calls are easier to test, easier to replay, and avoid indexing inside uncommitted transactions.--commit / full-vs-partial modes. You will use this command constantly during schema changes, and it decouples you from a bundle you may later have to drop.solarium.client service injected and use the bundle only for its indexing/mapping layer. Where the bundle's abstraction is thin or wrong for your case, drop to raw Solarium for that one operation — mixing is fine and normal with these wrapper bundles.%solr_host%). Give tests their own core or a mocked client so a flaky Solr socket doesn't fail CI.%parameter% substitution, and container-aware base classes are all pre-autowiring. If you are on a newer Symfony, expect manual service wiring and possibly a compiler-pass hack for injection.unknown field exceptions rather than clear errors.commitWithin or handle the eventual-consistency window in the UI. Reindex commands should commit once at the end, not per document.curl http://host:8983/solr/<core>/admin/ping; (2) is the right client/endpoint injected — dump the solarium.client service config; (3) does the raw Solarium query return what the bundle query returns — if yes, the bug is in hydration, if no, it's in query construction; (4) enable Solarium's event dispatcher logging to see the literal query and response. Nine times out of ten it's a mapping or field-name mismatch, not the bundle.schema.xml / managed schema, not in PHP. A "string" field that gets tokenized, or a date format that doesn't match, will silently return nothing. Keep schema and document class changes in the same commit.How can I help you explore Laravel packages today?