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

ActiveSymfony-bundle

ics/search-bundle
=================

A new bundle for symfony

0.0.2(4y ago)1291MITPHP

Since Jan 29Pushed 3y ago2 watchersCompare

[ Source](https://github.com/imperiumclansoftware/search-bundle)[ Packagist](https://packagist.org/packages/ics/search-bundle)[ RSS](/packages/ics-search-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (7)Versions (3)Used By (1)

Imperium Clan Software - Search Bundle
======================================

[](#imperium-clan-software---search-bundle)

Unified search for symfony

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

[](#installation)

Make sure Composer is installed globally, as explained in the [installation chapter](https://getcomposer.org/doc/00-intro.md)of the Composer documentation.

### Applications that use Symfony Flex

[](#applications-that-use-symfony-flex)

Open a command console, enter your project directory and execute:

```
composer require ics/search-bundle
```

### Applications that don't use Symfony Flex

[](#applications-that-dont-use-symfony-flex)

#### Step 1: Download the Bundle

[](#step-1-download-the-bundle)

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

```
$ composer require ics/search-bundle
```

#### Step 2: Enable the Bundle

[](#step-2-enable-the-bundle)

Then, enable the bundle by adding it to the list of registered bundles in the `config/bundles.php` file of your project:

```
// config/bundles.php

return [
    // ...
    ICS\SearchBundle\SearchBundle::class => ['all' => true],
];
```

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

[](#configuration)

### Routing

[](#routing)

Add this lines to `config/routes.yaml`

```
search_bundle:
  resource: '@SearchBundle/config/routes.yaml'
  prefix: /search
```

Usage
-----

[](#usage)

### Integrate an entity to the global search

[](#integrate-an-entity-to-the-global-search)

#### 1- Implements Interface `EntitySearchInterface` in your entity.

[](#1--implements-interface-entitysearchinterface-in-your-entity)

```
# src/Entity/User.php

use ICS\SearchBundle\Entity\EntitySearchInterface;

class User implements EntitySearchInterface
{
    // Define name show in search results interface
    public static function getEntityClearName(): string
    {
        return "Application User";
    }
    // Define Template of the results
    public static function getSearchTwigTemplate(): string
    {
        return "search/result.html.twig";
    }
    // Define ROLES have access to the results
    public static function getRolesSearchEnabled(): array
    {
        return [
            'ROLE_ADMIN'
        ];
    }

}
```

#### 2- Implements Interface `EntitySearchRepositoryInterface` in the entity repository

[](#2--implements-interface-entitysearchrepositoryinterface-in-the-entity-repository)

```
# src/Repository/UserRepository.php

use ICS\SearchBundle\Entity\EntitySearchRepositoryInterface;

class UserRepository extends ServiceEntityRepository implements EntitySearchRepositoryInterface
{
    public function __construct(ManagerRegistry $registry)
    {
        parent::__construct($registry, User::class);
    }

    public function search(string $search) : ?Collection
    {
        $results = $this->createQueryBuilder('u')
            ->where('lower(u.name) LIKE lower(:search)')
            ->orWhere('lower(u.surname) LIKE lower(:search)')
            ->setParameter('search', "%".$search."%")
            ->orderBy('u.name', 'ASC')
            ->getQuery()
            ->getResult();
        return new ArrayCollection($results);
    }

}
```

#### 3- Define HTML Twig for the entity search result

[](#3--define-html-twig-for-the-entity-search-result)

Each result entity are in `result` variable. The user search word are in `search` variable.

```
{# templates/search/result.html.twig #}

            {% if result.avatar %}

            {% endif %}

                {{ hightlight(result,search) }}
                Gallery : {{ result.gallery|length }} elements

```

For help to highlight return a twig function are implemented to use this feature make search fields in function argument.

```
    {# Highlight property ## name ## of result from ## search ## #}

    {{ hightlight(result.name,search) }}

    {# You can personalise the class of highlight #}

    {{ hightlight(result.name,search,'bg-success text-light') }}
```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

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

Total

2

Last Release

1566d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1b8cd72721fa699d3afa402c0057a9438c0556e734f1128e6ffff0212f3afa42?d=identicon)[ics](/maintainers/ics)

---

Top Contributors

[![ddutas](https://avatars.githubusercontent.com/u/46941784?v=4)](https://github.com/ddutas "ddutas (3 commits)")

### Embed Badge

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

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

###  Alternatives

[sylius/sylius

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

8.4k5.6M651](/packages/sylius-sylius)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k16.7M310](/packages/easycorp-easyadmin-bundle)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[sulu/sulu

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

1.3k1.3M152](/packages/sulu-sulu)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)

PHPackages © 2026

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