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

AbandonedSymfony-bundle[Search &amp; Filtering](/categories/search)

gnugat/search-engine-bundle
===========================

A gnugat/search-engine integration in symfony

v0.3.1(10y ago)078MITPHP

Since Aug 23Pushed 10y ago1 watchersCompare

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

READMEChangelog (4)Dependencies (8)Versions (5)Used By (0)

SearchEngine Bundle
===================

[](#searchengine-bundle)

A [gnugat/search-engine](http://gnugat.github.io/search-engine/) integration in [Symfony](http://symfony.com/).

> **Caution**: this component does not provide actual SearchEngine features, if you're looking for one you should rather have a look at ElasticSearch, Solr, etc. See `gnugat/search-engine`'s' [website](http://gnugat.github.io/search-engine/) for more information.

This bundle provides the following services:

- `gnugat_search_engine.criteria_factory`: creates `Criteria` from Request query parameters
- `gnugat_search_engine.identifier_engine`: an instance of `IdentifierEngine`
- `gnugat_search_engine.search_engine`: an instance of `SearchEngine`
- `gnugat_search_engine.type_sanitizer`: an instance of `TypeSanitizer`

In order for it to work, you need to:

1. create an implementations of `Fetcher` (or install an existing one, like [PommSearchEngine](https://github.com/gnugat/pomm-search-engine))
2. define it as a service with the name `gnugat_search_engine.fetcher`

Also, to be able to find anything `SearchEngine` and `IdentifierEngine` both need you to add information about available resources. This can be done by implementating `SelectBuilder` and define it as a service, for example:

```
services:
    app.blog_select_builder:
        class: AppBundle\SearchEngine\BlogSelectBuilder
        tags:
            -
                name: gnugat_search_engine.select_builder
                resource_name: blog
                resource_definition: |
                    {
                        "fields": {
                            "id": "integer",
                            "title": "string",
                            "author_id": "integer"
                        },
                        "relations": ["author"]
                    }

```

We can finally use it, for example in a controller:

```
