PHPackages                             mdiyakov/doctrine-solr-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. [Database &amp; ORM](/categories/database)
4. /
5. mdiyakov/doctrine-solr-bundle

ActiveSymfony-bundle[Database &amp; ORM](/categories/database)

mdiyakov/doctrine-solr-bundle
=============================

Symfony 2 bundle for integration Doctrine entities with Solr

v1.1.1(8y ago)1230MITPHPPHP ^5.4 || &gt;=7.0 &lt;7.3

Since Mar 24Pushed 8y ago2 watchersCompare

[ Source](https://github.com/mdiyakov/DoctrineSolrBundle)[ Packagist](https://packagist.org/packages/mdiyakov/doctrine-solr-bundle)[ RSS](/packages/mdiyakov-doctrine-solr-bundle/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (4)Dependencies (7)Versions (7)Used By (0)

DoctrineSolrBundle
==================

[](#doctrinesolrbundle)

[![SensioLabsInsight](https://camo.githubusercontent.com/3c233490921e895c52477ffb4c06412a069f1aa491e467b75cfe573f3084f4fd/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f31383936323130322d323532662d346532362d613939302d3337303732643330363162372f736d616c6c2e706e67)](https://insight.sensiolabs.com/projects/18962102-252f-4e26-a990-37072d3061b7)[![Build Status](https://camo.githubusercontent.com/5f497a3aa43f52f0fd6421ae91cb74e0aca717ee34ecb91d442db6773289be58/68747470733a2f2f7472617669732d63692e6f72672f6d646979616b6f762f446f637472696e65536f6c7242756e646c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/mdiyakov/DoctrineSolrBundle)[![Latest Stable Version](https://camo.githubusercontent.com/9c6009d370432a10de11f43dd374b826f0e8ff13b79fe827bd58720badbc5f6c/68747470733a2f2f706f7365722e707567782e6f72672f6d646979616b6f762f646f637472696e652d736f6c722d62756e646c652f762f737461626c65)](https://packagist.org/packages/mdiyakov/doctrine-solr-bundle)[![License](https://camo.githubusercontent.com/65f69eee73267df9715d5f472af51bf414683f5e1db4452c57d88736ff7d7707/68747470733a2f2f706f7365722e707567782e6f72672f6d646979616b6f762f646f637472696e652d736f6c722d62756e646c652f6c6963656e7365)](https://packagist.org/packages/mdiyakov/doctrine-solr-bundle)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/22e496366c2d3f96f93e6080113312fb58db02e5f7e73f123c22b4cc9ac33eb5/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d646979616b6f762f446f637472696e65536f6c7242756e646c652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/mdiyakov/DoctrineSolrBundle/?branch=master)

DoctrineSolrBundle is a Symfony bundle designed to mitigate Solr usage in symfony projects

Features
========

[](#features)

- Auto-indexing doctrine entities in Solr
- Supports wildcard, fuzzy &amp; negative searches by specific entity fields
- Supports Range searches by specific entity fields
- Supports Boosting a Term by specific entity fields
- Supports Solr SuggestComponent
- Supports filters by entity fields or custom symfony service before indexing
- Auto-resolving search results in Doctrine entities
- Supports implementation of separate finder class for particular entity class
- Flexible query building interface
- Cross-search over different entity classes

Installation
============

[](#installation)

### Step 1 Download DoctrineSolrBundle using composer

[](#step-1-download-doctrinesolrbundle-using-composer)

```
$ composer require mdiyakov/doctrine-solr-bundle

```

Composer will install the bundle to your project's vendor/mdiyakov/doctrine-solr-bundle directory.

### Step 2

[](#step-2)

Enable the bundle in the kernel :

```
// app/AppKernel.php

public function registerBundles()
{
	$bundles = array(
		// ...
		new Nelmio\SolariumBundle\NelmioSolariumBundle(),
		new Mdiyakov\DoctrineSolrBundle\MdiyakovDoctrineSolrBundle(),
		// ...
	);
}

```

> You have to install "NelmioSolariumBundle" also because it's used by MdiyakovDoctrineSolrBundle

### Step 3 : Quick start with DoctrineSolrBundle

[](#step-3--quick-start-with-doctrinesolrbundle)

#### Prerequisites

[](#prerequisites)

- Solr schema.yml created and solr core is initialized
- Solr schema.yml unique field is "uid"
- Solr schema.yml consists "document\_id", "document\_title" and "discriminator" fields
- AppBundle\\Entity\\MyEntity is created and has "id" and "title" fields

DoctrineSolrBundle is using ["NelmioSolariumBundle"](https://github.com/nelmio/NelmioSolariumBundle) for solarium integration. So you need to set a configuration to use it. Here is minimum config:

```
nelmio_solarium: ~
```

The default solr endpoint will be used in this case ()

Init bundle configuration in config.yml. Quick example:

```
 mdiyakov_doctrine_solr:
    indexed_entities:
        my_entity:
            class: AppBundle\Entity\MyEntity
            schema: my_schema
            config:
                - { name: config_field_name, value: config_field_value }
    schemes:
        my_schema:
            document_unique_field: { name: 'uid' }
            config_entity_fields:
                - {  config_field_name: 'config_field_name', document_field_name: 'discriminator', discriminator: true }
            fields:
                - {  entity_field_name: 'id', document_field_name: 'document_id', field_type: int, entity_primary_key: true }
                - {  entity_field_name: 'title', document_field_name: 'document_title', suggester: 'title' }
```

As a result "id" and "title" fields of "AppBundle\\Entity\\MyEntity" will be synced with Solr each time "AppBundle\\Entity\\MyEntity" is created, updated or removed.

> If you use doctrine/orm &lt; 2.5 then you have to add an annotation to "AppBundle\\Entity\\MyEntity" class:

```
@ORM\EntityListeners({"Mdiyakov\DoctrineSolrBundle\EventListener\DoctrineEntityListener"})

```

**To search "AppBundle\\Entity\\MyEntity" use the following code:**

```
// MyController
//...
// @var \Mdiyakov\DoctrineSolrBundle\Finder\ClassFinder $finder
$finder = $this->get('ds.finder')->getClassFinder(MyEntity::class);

/** @var MyEntity[] $searchResults */
$searchResults = $finder->findSearchTermByFields($searchTerm, ['title']);
//...
```

Next steps
----------

[](#next-steps)

1. [Getting started with DoctrineSolrBundle](Resources/doc/getting_started.md)
2. [ Regular, fuzzy, wildcard, range and negative search](Resources/doc/fuzzy_wildcard_range_negative_search.md)
3. [ Custom finder class ](Resources/doc/custom_finder_class.md)
4. [ Filters ](Resources/doc/filters.md)
5. [Schema search across multiple entities classes](Resources/doc/schema_search.md)
6. [Suggestions](Resources/doc/suggestions.md)
7. [Query building](Resources/doc/query_building.md)
8. [Console command to index entities](Resources/doc/console.md)
9. [Console command to delete entities ](Resources/doc/console_delete.md)
10. [EntityManager. How to flush an entity safe ](Resources/doc/entity_manager.md)
11. [Roadmap](https://github.com/mdiyakov/DoctrineSolrBundle/wiki/Roadmap-for-April,-2018)

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity62

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 ~19 days

Total

6

Last Release

2965d ago

PHP version history (2 changes)v1.0-RC1PHP ^5.4

v1.1.0PHP ^5.4 || &gt;=7.0 &lt;7.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8037233?v=4)[Mikhail Dyakov](/maintainers/mdiyakov)[@mdiyakov](https://github.com/mdiyakov)

---

Top Contributors

[![mdiyakov](https://avatars.githubusercontent.com/u/8037233?v=4)](https://github.com/mdiyakov "mdiyakov (101 commits)")

---

Tags

bundledoctrinefulltext-searchphpsearchsolrsymfonysymfony-bundlesymfony2symfony3searchsymfonyindexsolrfindfull-text

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mdiyakov-doctrine-solr-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/mdiyakov-doctrine-solr-bundle/health.svg)](https://phpackages.com/packages/mdiyakov-doctrine-solr-bundle)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k18.3M418](/packages/easycorp-easyadmin-bundle)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

12017.1k](/packages/rcsofttech-audit-trail-bundle)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1617.3k16](/packages/2lenet-crudit-bundle)[sylius/sylius

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

8.5k6.0M776](/packages/sylius-sylius)[sulu/sulu

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

1.3k1.4M231](/packages/sulu-sulu)[pimcore/pimcore

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

3.8k3.9M534](/packages/pimcore-pimcore)

PHPackages © 2026

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