PHPackages                             naroga/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. [Search &amp; Filtering](/categories/search)
4. /
5. naroga/search-bundle

ActiveLibrary[Search &amp; Filtering](/categories/search)

naroga/search-bundle
====================

An agnostic search bundle.

06PHP

Since Feb 11Pushed 10y agoCompare

[ Source](https://github.com/naroga/dh-search)[ Packagist](https://packagist.org/packages/naroga/search-bundle)[ RSS](/packages/naroga-search-bundle/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

[![Travis](https://camo.githubusercontent.com/b81b82bbfb1de1356bfed9d3acbbfe526f6127321d3064feb5daa9ec094f6f49/68747470733a2f2f7472617669732d63692e6f72672f6e61726f67612f64682d7365617263682e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/naroga/dh-querker)

Naroga's Search Bundle
======================

[](#narogas-search-bundle)

This is a search bundle, developed for exclusive usage of DistantJobHire.

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

[](#requirements)

This project makes use of some cool PHP 7.0 features (such as the Null Coalesce operator, Spaceship operator, scalar typehints, function return typehints and others). It also uses Symfony3, which means it shares its requirements. Additionally, you'll need the `php-curl` extension.

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

[](#installation)

To install this package, require it using composer:

```
$ composer require naroga/search-bundle dev-master

```

Usage
-----

[](#usage)

Indexing a document:

```
$ php bin/console search:add
File written successfully with ID

```

This indexes the file content.

Deleting a document:

```
$ php bin/console search:delete
 entries deleted successfully.

```

This deletes an indexed document.

Searching for a document:

```
$php bin/console search:search
Found  results:
...

```

This searches for documents containing matches from the provided expression.

Unit testing
------------

[](#unit-testing)

Clone this repository, install the dependencies using `composer install` and run `phpunit`.

Switching Search Engines
------------------------

[](#switching-search-engines)

To switch to another Search Engine (let's use MyCustomSearchEngine as an example), you'll have to create a new bundle.

```
$ php bin/console generate:bundle

```

Now, define this bundle as a parent of NarogaSearchBundle:

```
#MyCustomSearchBundle.php
class MyCustomSearchBundle extends Bundle
{
    public function getParent()
    {
        return 'NarogaSearchBundle';
    }
}

```

Now, create a new `MyCustomSearchEngine` class that implements `EngineInterface`:

```
class MyCustomSearchEngine implements EngineInterface
{
    public function add(string $name, string $content)
    {
        // TODO: Implement add() method.
    }

    public function search(string $expression) : array
    {
        // TODO: Implement search() method.
    }

    public function delete(string $id)
    {
        // TODO: Implement delete() method.
    }
}

```

In your services.yml file, define your search engine as a service:

```
services:
    mycustomengine.engine:
        class: My\Class\Path
        arguments: [ "here_come_your_dependencies" ]

```

Still in the `services` section, override the `naroga.search` service:

```
    naroga.search:
        class: Naroga\SearchBundle\Search\Search
        arguments: [ "@mycustomengine.engine" ] #pass your custom service here as a parameter.

```

Now you're good to go!

License
-------

[](#license)

This project is proprietary and thus cannot be used, copied, modified or distributed without explicit written consent from the owner (DistantJobHire).

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/67a9373bd6218e10eaa1941dd01ec5ea1299d4534870e5c88722ec978f658f9d?d=identicon)[naroga](/maintainers/naroga)

---

Top Contributors

[![naroga](https://avatars.githubusercontent.com/u/3511149?v=4)](https://github.com/naroga "naroga (28 commits)")

### Embed Badge

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

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

###  Alternatives

[awesome-nova/dependent-filter

Dependent filters for Laravel Nova

26190.2k](/packages/awesome-nova-dependent-filter)[algolia/php-dom-parser

A simple tool to turn DOM into Algolia search friendly record objects.

181.8k](/packages/algolia-php-dom-parser)

PHPackages © 2026

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