PHPackages                             tp/solarium-extensions-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. tp/solarium-extensions-bundle

AbandonedLibrary

tp/solarium-extensions-bundle
=============================

A collection of useful extensions for the NelmioSolariumBundle created by Seldaek.

2.1.0(13y ago)7362MITPHP

Since Mar 23Pushed 12y ago2 watchersCompare

[ Source](https://github.com/tPl0ch/TPSolariumExtensionsBundle)[ Packagist](https://packagist.org/packages/tp/solarium-extensions-bundle)[ RSS](/packages/tp-solarium-extensions-bundle/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (8)Versions (13)Used By (0)

TPSolariumExtensionsBundle
==========================

[](#tpsolariumextensionsbundle)

An extension for the [**NelmioSolariumBundle**](https://github.com/nelmio/NelmioSolariumBundle) which provides an AnnotationDriver for Document indexing configurations with support for multi-valued fields.

**WARNING - This Bundle is still in heavy development and, although it is working, it is far from finished. I urge you to report any bugs you might come across (and you probably will) in the issues section. Thanks in advance for your help!**

[![Build Status](https://camo.githubusercontent.com/fc6fa3bc8316f215a9e67735a8503a040526177af6e2e3de7b4aeaf68d686294/68747470733a2f2f7472617669732d63692e6f72672f74506c3063682f5450536f6c617269756d457874656e73696f6e7342756e646c652e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/tPl0ch/TPSolariumExtensionsBundle)

Requirements
------------

[](#requirements)

- Symfony &gt;= 2.2.0 (Since the PropertyAccess Component is used)
- NelmioSolariumBundle &gt;= 2.0.0
- solarium/solarium &gt;= 3.0.0
- jms/metadata dev-master
- doctrine/annotations dev-master
- doctrine/inflector dev-master

Installation
------------

[](#installation)

Add TPSolariumExtensionsBundle in your `composer.json`:

```
{
    "require": {
        "tp/solarium-extensions-bundle": "dev-master"
    }
}
```

Download Bundle:

```
php composer.phar update tp/solarium-extensions-bundle
```

Add the TPSolariumExtensionsBundle to your AppKernel.php:

```
public function registerBundles()
{
    $bundles = array(
        ...
        new TP\SolariumExtensionsBundle\TPSolariumExtensionsBundle(),
        ...
    );
    ...
}
```

**This is important to make this Bundle work correctly**

Make your `AppKernel` class implement `Symfony\Component\HttpKernel\TerminableInterface`:

```
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\HttpKernel\TerminableInterface;

class AppKernel extends Kernel implements TerminableInterface
{
    ...
}
```

Configuration
-------------

[](#configuration)

### Prerequisites

[](#prerequisites)

First configure the NelmioSolariumBundle clients as described [**here**](https://github.com/nelmio/NelmioSolariumBundle#basic-configuration):

### Configure metadata cache directory (if nessecary)

[](#configure-metadata-cache-directory-if-nessecary)

The ClassMetadata gets cached by default, and you can change the cache directory here.

TODO: Add configuration for different Cache engines.

```
tp_solarium_extensions:
    metadata_cache_dir: %kernel.cache_dir%/%kernel.environment%/solarium_extensions
```

Example Annotation configuration
--------------------------------

[](#example-annotation-configuration)

Check the comments on this class to get a fist hang of the configuration until I have written a proper documentation. The test suite is also a good point to check what's possible.

```
/**
 * This is the main Document Annotation. The Nelmio service id is mandatory in this case:
 *
 * @Solarium\Document("solarium.client.default")
 *
 * This is the same as:
 *
 * @Solarium\Document(
 *      operations={
 *          @Solarium\Operation("all", service="solarium.client.default")
 *      }
 * )
 *
 * Both these notations will listen to all 'save', 'update', and 'delete' transactions via postPersist,
 * postUpdate and postDelete. Commits will only be done when the kernel terminates, so that expensive
 * requests can be done when the Response is already sent to the Client.
 *
 * You can also assign different NelmioSolariumbundle clients to different operations. In the next
 * example, only 'save' and 'update' will be processed, with the coresponding Clients.
 *
 * @Solarium\Document(
 *      operations={
 *          @Solarium\Operation("save", service="solarium.client.save"),
 *          @Solarium\Operation("update", service="solarium.client.update")
 *      }
 * )
 *
 * But that's not all, you can even specify different endpoints for the same client!
 * In the following example, the "save" opration will use the "anotherOne" endpoint, while the
 * "update" operation uses the default endpoint for the given client service.
 *
 * @Solarium\Document(
 *      operations={
 *          @Solarium\Operation("save", service="solarium.client.save", endpoint="anotherOne"),
 *          @Solarium\Operation("update", service="solarium.client.update")
 *      }
 * )

 * You want to add a document boost? No problem:
 *
 * @Solarium\Document("solarium.client.default", boost="2.4")
 *
 * This is an example of the Mapping Annotation, which you can map field types to Solr's dynamic field
 * suffixes.
 * The strict parameter is for strict checking of field types. If no mapping is specified, a default
 * mapping taken from the current Solr default schema.xml file.
 *
 * @Solarium\Mapping(
 *      mapping={"text_multi"="_tmulti"},
 *      strict=false
 * )
 */
class Example
{
    /**
     * @var int
     *
     * This is the Id Annotation, which is **REQUIRED** on every document.
     * The value "custom_id" is the ID field in solr (if you omit the value, it defaults to 'id'), and
     * propertyAccess is the propertyPath for the new PropertyAccess component.
     *
     * @Solarium\Id("custom_id", propertyAccess="id")
     */
    public $id = 1423;

    /**
     * @var string
     *
     * Fields have as standard type Field::TYPE_STRING = 'string'
     *
     * @Solarium\Field()
     */
    public $string = 'string';

    /**
     * @var string
     *
     * @Solarium\Field(boost="2.3")
     */
    public $boostedField = 'boosted_string';

    /**
     * @var string
     *
     * Use the 'useMapping' parameter to control if you want the dynamic field suffix to be automatically
     * appended, which is the default behavior.
     *
     * @Solarium\Field(useMapping=true)
     */
    public $inflectedNoMapping = 'inflectedNoMapping';

    /**
     * @var string
     *
     * for BC with older Solr versions, inflecting the field names is recommended to work with older
     * filters and components.
     *
     * @Solarium\Field(inflect=true)
     */
    public $mappedNoInflection = 'mappedNoInflection';

    /**
     * @var string
     *
     * Use the 'name' parameter to generate a custom field name instead of the property name.
     *
     * @Solarium\Field(name="myCustomName")
     */
    public $customName = 'customName';

    /**
     * @var bool
     *
     * @Solarium\Field(type="boolean")
     */
    public $bool = false;

    /**
     * @var ArrayCollection
     *
     * The multi-valued field types need to be a Traversable, so either an array or sth that
     * implements \Traversable.
     * The propertyAccess parameter is **MANDATORY** for multi-valued field types, so that the
     * PropertyAccess component can fetch the values from the collection objects.
     *
     * @Solarium\Field(type="text_multi", propertyAccess="multiName")
     */
    public $collection;

    /**
     * @var array
     *
     * The special "__raw__" value for propertyAccess skips the value fetching and just takes the
     * raw items from the collection, like array('value1', 'value2', 'value3').
     *
     * @Solarium\Field(type="string_multi", propertyAccess="__raw__")
     */
    public $stringCollection;

    /**
     * @var object
     *
     * The propertyAccess parameter can also be used to extract a single value from a single
     * object. In this case imagine this object:
     *
     * $this->singleObject = new MySpecialObject();
     * $this->singleObject->title = "Hello propertyAccess on single object";
     *
     * The resulting string in the solr data will be "Hello propertyAccess on single object"!
     * And the PropertyAccess component is very good in guessing the access method, so you
     * don't have to worry if it's a getter, public var, or sth else.
     *
     * @Solarium\Field(type="string", propertyAccess="title")
     */
    public $singleObject;

    /**
     * @var \DateTime
     *
     * Date fields will be automatically converted from \DateTime to UTC Solr Time strings
     *
     * @Solarium\Field(type="date")
     */
    public $date;
}
```

Currently implemented Field types:
----------------------------------

[](#currently-implemented-field-types)

```
    const TYPE_INT           = 'integer';
    const TYPE_INT_MULTI     = 'integer_multi';
    const TYPE_STRING        = 'string';
    const TYPE_STRING_MULTI  = 'string_multi';
    const TYPE_LONG          = 'long';
    const TYPE_LONG_MULTI    = 'long_multi';
    const TYPE_TEXT          = 'text';
    const TYPE_TEXT_MULTI    = 'text_multi';
    const TYPE_BOOLEAN       = 'boolean';
    const TYPE_BOOLEAN_MULTI = 'boolean_multi';
    const TYPE_FLOAT         = 'float';
    const TYPE_FLOAT_MULTI   = 'float_multi';
    const TYPE_DOUBLE        = 'double';
    const TYPE_DOUBLE_MULTI  = 'double_multi';
    const TYPE_DATE          = 'date';
    const TYPE_DATE_MULTI    = 'date_multi';
```

TODO: Make extensive documentation available.

Run the testsuite
-----------------

[](#run-the-testsuite)

```
$ phpunit -c phpunit.xml.dist
```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~5 days

Recently: every ~12 days

Total

12

Last Release

4744d ago

Major Versions

1.0.4 → 2.0.02013-03-27

1.0.5 → 2.0.12013-03-28

1.0.x-dev → 2.0.x-dev2013-05-13

### Community

Maintainers

![](https://www.gravatar.com/avatar/a945fe9c27cf2c5aa7fe570291dc6dfaf300a1337b852c67c844511de22214b0?d=identicon)[tPl0ch](/maintainers/tPl0ch)

---

Top Contributors

[![tPl0ch](https://avatars.githubusercontent.com/u/115348?v=4)](https://github.com/tPl0ch "tPl0ch (20 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tp-solarium-extensions-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/tp-solarium-extensions-bundle/health.svg)](https://phpackages.com/packages/tp-solarium-extensions-bundle)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

7310.3k29](/packages/open-dxp-opendxp)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)[neos/flow

Flow Application Framework

862.0M451](/packages/neos-flow)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
