Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/internations/solrquerycomponent

Build Solr queries with ease
https://github.com/internations/solrquerycomponent

Last synced: 1 day ago
JSON representation

Build Solr queries with ease

Awesome Lists containing this project

README

        

# SolrQueryComponent

[![Test](https://github.com/InterNations/SolrQueryComponent/actions/workflows/tests.yaml/badge.svg)](https://github.com/InterNations/SolrQueryComponent/actions/workflows/tests.yaml)

#### 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](http://pecl.php.net/package/solr) or
[Solarium](http://www.solarium-project.org/).

### Examples

Build `name:"John Doe"^100`

```php
field('name', $eb->boost($eb->eq('John Doe'), 100));
```

And the same with the query string object:

```php
^'))
->setPlaceholder('name', 'John Doe')
->setPlaceholder('boost', 100);
```

Learn more on how to use the component in [docs/](docs).