PHPackages                             gales-petkopara/multi-search-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. gales-petkopara/multi-search-bundle

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

gales-petkopara/multi-search-bundle
===================================

Symfony bundle for Multi Criteria Search for doctrine entities using Form or Service.

v2.7.1(8mo ago)05781MITPHP

Since Oct 24Pushed 1mo agoCompare

[ Source](https://github.com/GALes/PetkoparaMultiSearchBundle)[ Packagist](https://packagist.org/packages/gales-petkopara/multi-search-bundle)[ Docs](https://github.com/petkopara/PetkoparaMultiSearchBundle)[ RSS](/packages/gales-petkopara-multi-search-bundle/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (6)Dependencies (3)Versions (9)Used By (1)

MultiSearchBundle
=================

[](#multisearchbundle)

This bundle provides basic service and form type for Multi Search in Doctrine.

[![Build Status](https://camo.githubusercontent.com/09b0c4fde9363fdeaed954e62f67736ce85528f9e673531634880afe3f276de6/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7065746b6f706172612f5065746b6f706172614d756c746953656172636842756e646c652f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/petkopara/PetkoparaMultiSearchBundle/build-status/master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/7c3ccfadbf278eea2633232b061349a2aae91941e850081b3a1b47145a37ed29/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7065746b6f706172612f5065746b6f706172614d756c746953656172636842756e646c652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/petkopara/PetkoparaMultiSearchBundle/?branch=master)[![SensioLabsInsight](https://camo.githubusercontent.com/9832a6414da6f0baf783ab6770f17b4f53a6b5a00ac1dcedb8d33a53c828cd4c/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f34363238373466382d323238642d346439632d393531652d6535633030316134316334362f6d696e692e706e67)](https://insight.sensiolabs.com/projects/462874f8-228d-4d9c-951e-e5c001a41c46)[![Latest Stable](https://camo.githubusercontent.com/e1664870a783f67a1e45b437538b006941792477919bb44ed171119144e4b4ed/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7065746b6f706172612f6d756c74692d7365617263682d62756e646c652e7376673f6d61784167653d323539323030303f7374796c653d666c61742d737175617265)](https://packagist.org/packages/petkopara/multi-search-bundle)[![Total Downloads](https://camo.githubusercontent.com/1cea9a576a10eda2df4da3ae03f21fbb03259513d1b072f83f1c7798d288ae7a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7065746b6f706172612f6d756c74692d7365617263682d62756e646c652e7376673f6d61784167653d323539323030303f7374796c653d666c61742d737175617265)](https://packagist.org/packages/petkopara/multi-search-bundle)

Description
-----------

[](#description)

Search in all of entity columns by given search term. In response returns `Doctrine\ORM\QueryBuilder` containing the multiple search criteria. The searched columns can be specified.

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

[](#installation)

### Using composer

[](#using-composer)

```
composer require petkopara/multi-search-bundle

```

Add it to the `AppKernel.php` class:

```
new Petkopara\MultiSearchBundle\PetkoparaMultiSearchBundle(),

```

\##Usage

### Service

[](#service)

You can directly use the service and to apply the multi search to any doctrine query builder.

```
public function indexAction(Request $request)
{
    $search = $request->get('search');
    $em = $this->getDoctrine()->getManager();

    $qb = $em->getRepository('AppBundle:Post')->createQueryBuilder('e');
    $qb = $this->get('petkopara_multi_search.builder')->searchEntity($qb, 'AppBundle:Post', $search);
   //$qb = $this->get('petkopara_multi_search.builder')->searchEntity($qb, 'AppBundle:Post', $search, array('name', 'content'), 'wildcard');

    ..
}

```

### Form

[](#form)

Create your form type and include the multiSearchType in the buildForm function:

```
use Petkopara\MultiSearchBundle\Form\Type\MultiSearchType;

public function buildForm(FormBuilderInterface $builder, array $options)
{
    $builder
            ->add('search', MultiSearchType::class, array(
                'class' => 'AppBundle:Post', //required
                'search_fields' => array( //optional, if it's empty it will search in the all entity columns
                    'name',
                    'content'
                 ),
                 'search_comparison_type' => 'wildcard' //optional, what type of comparison to applied ('wildcard','starts_with', 'ends_with', 'equals')

            ))
    ;
}

```

In the controller add call to the multi search service:

```
public function indexAction(Request $request)
{
    $search = $request->get('search');
    $em = $this->getDoctrine()->getManager();
    $queryBuilder = $em->getRepository('AppBundle:Post')->createQueryBuilder('e');
    $filterForm = $this->createForm('AppBundle\Form\PostFilterType');

    // Bind values from the request
    $filterForm->handleRequest($request);

    if ($filterForm->isValid()) {
        // Build the query from the given form object
        $queryBuilder = $this->get('petkopara_multi_search.builder')->searchForm($queryBuilder, $filterForm->get('search'));
    }

    ..
}

```

Render your form in the view

```
{{ form_rest(filterForm) }}

```

Available Options
-----------------

[](#available-options)

The provided type has 2 options:

- `search_fields` - array of the entity columns that will be added in the search. If it's not set then will search in all columns
- `search_comparison_type` - how to compare the search term.

    - `wildcard` - it's equivalent to the %search% like search.
    - `equals` - like operator without wildcards. Wildcards still can be used with `equals` if the search term contains \*.
    - `starts_with` - it's equivalent to the %search like search.
    - `ends_with` - it's equivalent to the search% like search.

These parameters can be applyed to the service as well as 4th and 5th parameter to `searchEntity()` method

Author
------

[](#author)

Petko Petkov -

License
-------

[](#license)

MultiSearchBundle is licensed under the MIT License.

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance78

Regular maintenance activity

Popularity15

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 77.5% 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 ~540 days

Recently: every ~456 days

Total

7

Last Release

251d ago

Major Versions

v1.0.0 → v2.0.12020-09-02

### Community

Maintainers

![](https://www.gravatar.com/avatar/03b923dfb0e74c26d982c54853a58410bd82d289be004290f10a6f51451223bb?d=identicon)[gales](/maintainers/gales)

---

Top Contributors

[![petkopara](https://avatars.githubusercontent.com/u/2778679?v=4)](https://github.com/petkopara "petkopara (31 commits)")[![tacman](https://avatars.githubusercontent.com/u/619585?v=4)](https://github.com/tacman "tacman (9 commits)")

---

Tags

doctrinequery buildercriteriasymfony3multi-search

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/gales-petkopara-multi-search-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/gales-petkopara-multi-search-bundle/health.svg)](https://phpackages.com/packages/gales-petkopara-multi-search-bundle)
```

###  Alternatives

[scienta/doctrine-json-functions

A set of extensions to Doctrine that add support for json query functions.

58723.9M36](/packages/scienta-doctrine-json-functions)[laravel-doctrine/orm

An integration library for Laravel and Doctrine ORM

8425.3M87](/packages/laravel-doctrine-orm)[sonata-project/doctrine-orm-admin-bundle

Integrate Doctrine ORM into the SonataAdminBundle

46117.7M155](/packages/sonata-project-doctrine-orm-admin-bundle)[damienharper/auditor-bundle

Integrate auditor library in your Symfony projects.

4542.8M](/packages/damienharper-auditor-bundle)[petkopara/multi-search-bundle

Symfony bundle for Multi Criteria Search for doctrine entities using Form or Service.

1766.2k3](/packages/petkopara-multi-search-bundle)[mediagone/doctrine-specifications

Doctrine implementation of repository Specifications pattern

353.8k3](/packages/mediagone-doctrine-specifications)

PHPackages © 2026

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