internations / solr-query-component
Build Solr queries with ease
Installs: 204 784
Dependents: 0
Suggesters: 0
Security: 0
Stars: 63
Watchers: 39
Forks: 14
Open Issues: 3
Requires
- php: >=7.4
- internations/solr-utils: ~0.8
- lstrojny/functional-php: ~0.1|~1.0
Requires (Dev)
This package is auto-updated.
Last update: 2024-11-29 04:07:01 UTC
README
Build Solr queries with ease
SolrQueryComponent
helps building Solr/Lucene/ElasticSearch queries with a query builder API. It is independent of
the concrete client library and can be used with e.g. PECL Solr or
Solarium.
Examples
Build name:"John Doe"^100
<?php use InterNations\Component\Solr\Expression\ExpressionBuilder; $eb = new ExpressionBuilder(); echo $eb->field('name', $eb->boost($eb->eq('John Doe'), 100));
And the same with the query string object:
<?php use InterNations\Component\Solr\Query\QueryString; echo (new QueryString('name:<name>^<boost>')) ->setPlaceholder('name', 'John Doe') ->setPlaceholder('boost', 100);
Learn more on how to use the component in docs/.