Solarium is an opensource Solr client library for PHP applications

By offering an API for common Solr functionality you no longer need to compose complex querystrings and parameters manually, greatly reducing development time and complexity. Take a look at the examples shown above for a first impression. To get a good view of the difference compared to other Solr clients or manual requests see Why Solarium?

Some Solarium features:

Facet support

Complex facet queries a supported. Multiple facet types, global and per-facet options, tagging, excluding and more!

Query building API

Instead of manually creating a querystring and params you can use an API. This API also allows for easy modification of existing queries. The complete API has phpdocs to integrate with IDE features like autocompletion.

Complex update queries

Easily combine multiple add, delete, commit, optimize and/or rollback commands into a single update query. No more XML building.

Query inheritance

In Solarium a query is represented by an object. By using standard class inheritance for these objects together with the API you effectively get query inheritance, a very powerful concept.

Plugin system

The plugin system allows you to customize almost any part of Solarium. It's also used by Solarium itself for offering optional functionality, so it doesn't get bloated.

DisMax support

Enabling DisMax for a select query is just a single API call or config setting. All features, including boost parameters, are supported. Basic edismax support is also available.

Configuration mode

Almost all parts of Solarium can be created based on a config file. Instead of creating very complex queries with lots of API calls you can define them in a config file. The object created after loading the config file can still be modified using the API.

Spatial search

While very useful, the Solr Spatial functions and filters can be somewhat complex to write. Solarium offers an easy to use API for this (by means of a query helper)

MoreLikeThis

Get similar documents for your search results using MoreLikeThis (MLT). Solarium offers a query API to set MLT options and a result API to easily retrieve the MLT results for a search result.

Highlighting

Get highlighted matches for field values using Highlighting (HL). Solarium offers a query API to set HL options and a result API to easily retrieve the HL results for a search result document.

Grouping support

Solr grouping (also referred to as ‘field collapse’) is supported. You can group query results on field values, queries, or even both.

Querystring builder with escaping

Inserting (user)data into a querystring? With built-in term and phrase escaping you can do this safely. To make this even easier to use a special querystring builder somewhat similar to SQL prepared statements is available.