{"id":19291078,"url":"https://github.com/ongr-io/filtermanagerbundle","last_synced_at":"2025-07-10T09:33:35.094Z","repository":{"id":22587385,"uuid":"25929085","full_name":"ongr-io/FilterManagerBundle","owner":"ongr-io","description":"Filter manager bundle for product lists.","archived":false,"fork":false,"pushed_at":"2022-05-30T08:51:07.000Z","size":819,"stargazers_count":26,"open_issues_count":18,"forks_count":43,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-04-10T01:13:36.104Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ongr-io.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-10-29T16:04:43.000Z","updated_at":"2023-05-09T21:45:43.000Z","dependencies_parsed_at":"2022-08-21T08:01:00.467Z","dependency_job_id":null,"html_url":"https://github.com/ongr-io/FilterManagerBundle","commit_stats":null,"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ongr-io%2FFilterManagerBundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ongr-io%2FFilterManagerBundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ongr-io%2FFilterManagerBundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ongr-io%2FFilterManagerBundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ongr-io","download_url":"https://codeload.github.com/ongr-io/FilterManagerBundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248137891,"owners_count":21053775,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T22:23:37.229Z","updated_at":"2025-04-10T01:13:47.262Z","avatar_url":"https://github.com/ongr-io.png","language":"PHP","readme":"# ONGR FilterManagerBundle\n\nFilter manager is used for listing documents. It provides ties between commonly used filtering options and UI elements with Elasticsearch repositories.\nIt is important to mention that filtering is everything what has impact on list, it can be:\n- Filtering on specific field value object have (color, country etc.)\n- Filtering range (price range, distance from point etc.)\n- Documents list pagination. Paging changes representation of list, so it is considered to be filter and is treated like one.\n- Documents list sorting. Same as paging - sorting is filter in this bundle.\n- Any custom factor which has influence (not always directly visible) on result list. It can exclude, boost, modify some results, collect some metrics or any other action you can imagine.\n\nIf you need any help, [stack overflow](http://stackoverflow.com/questions/tagged/ongr)\nis the preffered and recommended way to ask ONGR support questions.\n\n[![Build Status](https://travis-ci.org/ongr-io/FilterManagerBundle.svg?branch=master)](https://travis-ci.org/ongr-io/FilterManagerBundle)\n[![Coverage Status](https://coveralls.io/repos/ongr-io/FilterManagerBundle/badge.svg?branch=master\u0026service=github)](https://coveralls.io/github/ongr-io/FilterManagerBundle?branch=master)\n[![Latest Stable Version](https://poser.pugx.org/ongr/filter-manager-bundle/v/stable)](https://packagist.org/packages/ongr/filter-manager-bundle)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/ongr-io/FilterManagerBundle/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/ongr-io/FilterManagerBundle/?branch=master)\n\n\n## Documentation\n\nFor online documentation of the bundle [click here](http://docs.ongr.io/FilterManagerBundle). All docs pages are located in `Resources/doc/`.\n\n## Installation\n\n### Step 1: Install FilterManager bundle\n\nFilterManager bundle is installed using [Composer](https://getcomposer.org).\n\n```bash\n# You can require any version you need, check the latest stable to make sure you are using the newest version.\n$ composer require ongr/filter-manager-bundle \"~3.0\"\n```\n\n\u003e Please note that filter manager requires Elasticsearch bundle, guide on how to install and configure it can be found [here](https://github.com/ongr-io/ElasticsearchBundle).\n\n### Step 2: Enable FilterManager bundle\n\nEnable Filter Manager bundle in your AppKernel:\n\n```php\n// config/bundles.php\n\n\u003c?php\n\nreturn [\n    ...\n\n    ONGR\\ElasticsearchBundle\\ONGRElasticsearchBundle::class =\u003e ['all' =\u003e true],\n    ONGR\\FilterManagerBundle\\ONGRFilterManagerBundle::class =\u003e ['all' =\u003e true],\n    JMS\\SerializerBundle\\JMSSerializerBundle::class =\u003e ['all' =\u003e true],\n\n    ...\n];\n```\n\n### Step 3: Add configuration for manager\n\nAdd minimal configuration for Elasticsearch and FilterManager bundles.\n\n```yaml\n# app/config/config.yml\n\nongr_elasticsearch:\n  indexes:\n    App\\Document\\Product:\n      hosts: \n         - 127.0.0.1:9200 \n\nongr_filter_manager:\n    managers:\n        search_list: # \u003c- Filter manager name\n            filters:\n                - country\n            repository: App\\Document\\Product # \u003c- Product document rindex service (used to be a repository prior to v3.0)\n    filters:\n        country: # \u003c- Filter name\n            type: choice\n            request_field: country\n            document_field: country\n```\n\u003e Note that `Product` document has to be defined. More about that in ElasticsearchBundle [documentation](https://github.com/ongr-io/ElasticsearchBundle/blob/master/Resources/doc/mapping.md).\n\nIn this particular example, we defined a single filter manager named `search_list` to filter documents from product repository, and we will be using the filter named `country` to filter on countries defined in document.\n\n### Step 4: Use your new bundle\n\nFilterManagerBundle is ready to use. When you define filter manager the bundle generates a service according manager name. In this particular case it will be `ongr_filter_manager.manager.search_list`.\n\nTo get a list grab the service and call `handleRequest()`. Here's a short example in the controller:\n\n  ```php\n  \u003c?php\n   \n  use ONGR\\FilterManagerBundle\\DependencyInjection\\ONGRFilterManagerExtension;\n  use Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller;\n  use Symfony\\Component\\HttpFoundation\\Request;\n  use Symfony\\Component\\HttpFoundation\\Response;\n   \n  class ProductController extends Controller\n  {\n      /**\n       * @param Request $request Request.\n       *\n       * @return Response\n       */\n      public function listAction(Request $request)\n      {\n          $searchList = $this-\u003eget(ONGRFilterManagerExtension::getFilterManagerId('search_list'))\n                            -\u003ehandleRequest($request);\n          $this-\u003erender(\n              'AppBundle:Product:list.html.twig',\n              [\n                'filters' =\u003e $searchList-\u003egetFilters(),  \n                'products' =\u003e $searchList-\u003egetResult(),  \n              ]\n          );                  \n      }\n  }\n  ```\n  \n  \u003e More information how to use filters and render the results are in [basics topic here](http://docs.ongr.io/FilterManagerBundle/Basics).\n  \n## Troubleshooting\n\nIf you face any issue or difficulty by implementing bundle, do not be afraid to create an issue with bug or question. Also ONGR organization has a tag in [Stackoverflow](http://stackoverflow.com/questions/tagged/ongr) so you can ask about all ONGR bundles also there.\n\n\n## License\n\nThis bundle is covered by the MIT license. Please see the complete license in the bundle [LICENSE](LICENSE) file.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fongr-io%2Ffiltermanagerbundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fongr-io%2Ffiltermanagerbundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fongr-io%2Ffiltermanagerbundle/lists"}