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

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

sgloe/multi-search-bundle
=========================

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

v0.0.6(4mo ago)217↓93.3%MITPHPPHP ^8.5

Since Nov 28Pushed 4mo agoCompare

[ Source](https://github.com/sgloe/MultiSearchBundle)[ Packagist](https://packagist.org/packages/sgloe/multi-search-bundle)[ Docs](https://github.com/sgloe/MultiSearchBundle)[ RSS](/packages/sgloe-multi-search-bundle/feed)WikiDiscussions master Synced today

READMEChangelog (5)Dependencies (2)Versions (7)Used By (0)

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

[](#multisearchbundle)

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

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 sgloe/multi-search-bundle

```

Add it to your `config/bundles.php`:

```
Sgloe\MultiSearchBundle\SgloeMultiSearchBundle::class => ['all' => true],

```

Usage
-----

[](#usage)

### Service

[](#service)

You can inject the service and apply the multi search to any Doctrine query builder.

```
use Sgloe\MultiSearchBundle\Service\MultiSearchBuilderService;

public function __construct(
    private MultiSearchBuilderService $multiSearchBuilder,
    private EntityManagerInterface $entityManager,
) {}

public function index(Request $request): Response
{
    $search = $request->query->get('search');

    $qb = $this->entityManager->getRepository(Post::class)->createQueryBuilder('e');
    $qb = $this->multiSearchBuilder->searchEntity($qb, Post::class, $search);
    //$qb = $this->multiSearchBuilder->searchEntity($qb, Post::class, $search, ['name', 'content'], 'wildcard');

    ..
}

```

### Form

[](#form)

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

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

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

```

In the controller, inject the service and call the multi search:

```
use Sgloe\MultiSearchBundle\Service\MultiSearchBuilderService;

public function __construct(
    private MultiSearchBuilderService $multiSearchBuilder,
    private EntityManagerInterface $entityManager,
) {}

public function index(Request $request): Response
{
    $queryBuilder = $this->entityManager->getRepository(Post::class)->createQueryBuilder('e');
    $filterForm = $this->createForm(PostFilterType::class);

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

    if ($filterForm->isSubmitted() && $filterForm->isValid()) {
        // Build the query from the given form object
        $queryBuilder = $this->multiSearchBuilder->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)

Sgloe

Thanks to Petko Petkov, who originally wrote this bundle. Since it is not maintained anymore, I started this fork.

License
-------

[](#license)

MultiSearchBundle is licensed under the MIT License.

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance76

Regular maintenance activity

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 69.8% 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 ~90 days

Recently: every ~112 days

Total

6

Last Release

132d ago

PHP version history (2 changes)v0.0.4PHP ^8.4

v0.0.5PHP ^8.5

### Community

Maintainers

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

---

Top Contributors

[![petkopara](https://avatars.githubusercontent.com/u/2778679?v=4)](https://github.com/petkopara "petkopara (30 commits)")[![tacman](https://avatars.githubusercontent.com/u/619585?v=4)](https://github.com/tacman "tacman (8 commits)")[![sgloe](https://avatars.githubusercontent.com/u/5596269?v=4)](https://github.com/sgloe "sgloe (5 commits)")

---

Tags

symfonydoctrinequery buildercriteriamulti-search

### Embed Badge

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

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

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M388](/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.

1189.8k](/packages/rcsofttech-audit-trail-bundle)[kimai/kimai

Kimai - Time Tracking

4.8k9.0k1](/packages/kimai-kimai)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1616.4k14](/packages/2lenet-crudit-bundle)

PHPackages © 2026

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