{"id":18937480,"url":"https://github.com/rollerworks/search","last_synced_at":"2025-12-17T02:19:18.509Z","repository":{"id":9889521,"uuid":"11894231","full_name":"rollerworks/search","owner":"rollerworks","description":"PHP search-systems made possible","archived":false,"fork":false,"pushed_at":"2024-09-18T09:23:41.000Z","size":5929,"stargazers_count":109,"open_issues_count":11,"forks_count":18,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-21T15:12:43.831Z","etag":null,"topics":["doctrine","elasticsearch","php","rollerworks","rollerworkssearch","search","symfony"],"latest_commit_sha":null,"homepage":"https://rollerworkssearch.readthedocs.io/en/latest/index.html","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/rollerworks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-08-05T09:03:44.000Z","updated_at":"2024-09-18T09:21:31.000Z","dependencies_parsed_at":"2024-08-29T20:56:49.914Z","dependency_job_id":"6199e561-3b0b-486d-a774-5f95fba9f355","html_url":"https://github.com/rollerworks/search","commit_stats":{"total_commits":1416,"total_committers":13,"mean_commits":"108.92307692307692","dds":"0.043785310734463234","last_synced_commit":"9d766edc98896227855d24923782d878feb11610"},"previous_names":[],"tags_count":49,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollerworks%2Fsearch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollerworks%2Fsearch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollerworks%2Fsearch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollerworks%2Fsearch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rollerworks","download_url":"https://codeload.github.com/rollerworks/search/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246911498,"owners_count":20853657,"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":["doctrine","elasticsearch","php","rollerworks","rollerworkssearch","search","symfony"],"created_at":"2024-11-08T12:11:20.178Z","updated_at":"2025-12-17T02:19:13.454Z","avatar_url":"https://github.com/rollerworks.png","language":"PHP","readme":"RollerworksSearch\n=================\n\n## About RollerworksSearch\n\nRollerworksSearch is a powerful search-system for PHP.\nCreated to make searching in a PHP powered application as simple and fast as possible.\n\nWhether you want to search for users in your SQL database, want to provide a \npowerful search system for searching products using an ElasticSearch back-end \nor are looking for a way to abstract filtering for a reporter.\n \n ##### :warning: RollerworksSearch v2.0 is not stable yet, backward compatible changes should be expected.\n ##### If you are looking for a stable version, please wait for a final v2.0 release.\n\n### How about complex data structures?\n\nA complex data is structure is no problem, say your customer data is stored\nin the \"customer\" table, the \"invoices\" data is stored in it's own table, and\nthe details of the invoices have there own table.\n\nInstead of writing a very verbose SQL query, your users can use the easy to learn\nStringQuery syntax:\n\n\u003e `invoice-price: \u003e $20.00; invoice-row-label: ~*\"my cool product\"; customer-type: !consumer`.\n\nYou just searched in three relational tables using a single condition with a\nuser-friendly syntax. And that is just the start, RollerworksSearch can work with\nany locale, custom input format, or storage system.\n\nSearch conditions can be as simple or complex as you need them to be.\nIncluding grouping and nesting for the best possible result.\n\n## Features\n\nRollerworksSearch provides you with most of the features you would expect\nfrom a search system, including:\n\n* Localized input processing using the StringQuery format;\n* User-friendly format validation;\n* Integration with API-Platform;\n* Integration for Symfony 4.4 and up (Symfony Flex supported).\n\nAnd support for the most poplar storage systems.\n\n* [Doctrine DBAL](https://github.com/rollerworks/search-doctrine-dbal)\n* [Doctrine ORM](https://github.com/rollerworks/search-doctrine-orm)\n* [ElasticSearch](https://github.com/rollerworks/search-elasticsearch)\n\n## Installation and usage\n\n*Please ignore the instructions below if your use a framework integration.*\n\n[Read the Documentation][4] for complete instructions and information.\n\nInstall the RollerworksSearch \"core\" library using [Composer][1]:\n\n```bash\n$ composer install rollerworks/search\n```\n\nAnd create the `SearchFactory` to get started.\n\n```php\nuse Rollerworks\\Component\\Search\\Searches;\nuse Rollerworks\\Component\\Search\\Exception\\InvalidSearchConditionException;\nuse Rollerworks\\Component\\Search\\Extension\\Core\\Type\\TextType;\nuse Rollerworks\\Component\\Search\\Extension\\Core\\Type\\IntegerType;\nuse Rollerworks\\Component\\Search\\Extension\\Core\\Type\\ChoiceType;\nuse Rollerworks\\Component\\Search\\Input\\ErrorPathHumanizer;\nuse Rollerworks\\Component\\Search\\Input\\StringQueryInput;\nuse Rollerworks\\Component\\Search\\Input\\ProcessorConfig;\n\n// The factory is reusable, you create it only once.\n$searchFactory = Searches::createSearchFactory();\n\n// Create a fieldset to inform the system about your configuration.\n// Usually you will have a FieldSet for each data structure (users, invoices, etc).\n$userFieldSet = $searchFactory-\u003ecreateFieldSetBuilder()\n    -\u003eadd('firstName', TextType::class)\n    -\u003eadd('lastName', TextType::class)\n    -\u003eadd('age', IntegerType::class)\n    -\u003eadd('type', ChoiceType::class, [\n        'choices' =\u003e ['Consumer' =\u003e 'c', 'Business' =\u003e 'b'],\n    ])\n    -\u003egetFieldSet('users');\n    \n// Now lets process a string query.\n// Tip: the input processor is reusable.\n$inputProcessor = new StringQueryInput();\n\ntry {\n    // The ProcessorConfig allows to limit the amount of values, groups\n    // and maximum nesting level. The defaults should be restrictive enough\n    // for most situations.\n    $processorConfig = new ProcessorConfig($userFieldSet);\n    \n    // The `process` method processes the input and produces \n    // a valid SearchCondition (or throws an exception when something is wrong).\n    $condition = $inputProcessor-\u003eprocess('firstName: sebastiaan, melany;');\n} catch (InvalidSearchConditionException $e) {\n    // Each error message can be transformed to a localized version\n    // using the Symfony Translator contract.\n    \n    $translator = ...; // \\Symfony\\Contracts\\Translation\\TranslatorInterface\n    \n    // Note: The ErrorPathHumanizer only works for the `StringQueryInput` input processor.\n    $errorPathHumanizer = new ErrorPathHumanizer($translator);\n    \n    foreach ($e-\u003egetErrors() as $error) {\n       echo '\u003cspan\u003e' $errorPathHumanizer-\u003ehumanize($error-\u003epath) .  ' \u003c/span\u003e\u003cspan\u003e' . htmlentities($error-\u003etrans($translator), ENT_COMPAT | ENT_IGNORE, 'UTF-8') '\u003c/span\u003e' . PHP_EOL;\n    }\n}\n```\n\nThat's it! The `$condition` contains the SearchCondition in a normalized\ndata format which can be used in a condition processor (like ElasticSearch), \nor be exported into another format like JSON for easier usage in a URL.\n\n\u003e **Note:** RollerworksSearch is composed of multiple separate packages (to keep the architecture slim), \n\u003e the \"core\" package provides everything you need to get started.\n\u003e\n\u003e Searching a (document) storage requires the installation of additional packages. \n\n### What about validation?\n\nEach field type ensures the value is transformed to the correct format,\neither a date input is automatically transformed to a `DateTimeImuttable` object.\n\nA field that expects an integer will fail when the provided input is not an integer.\n\nTo enforce more strict constraints like a maximum amount for an integer field you\ncan use the [Symfony Validator extension](https://rollerworkssearch.readthedocs.io/en/latest/integration/symfony_validator.html).\n\n## Resources\n\n* [Read the Documentation][4]\n* RollerworksSearch is maintained under the [Semantic Versioning guidelines](http://semver.org/)\n\n## Who is behind RollerworksSearch?\n\nRollerworksSearch is brought to you by [Sebastiaan Stok](https://github.com/sstok).\n\n## License\n\nRollerworksSearch is released under the [MIT license](LICENSE).\n\nThe types and extensions are largely inspired on the Symfony Form Component, \nand contain a big amount of code from the Symfony project.\n\n## Support\n\nUse the issue tracker to create a new [support question](https://github.com/rollerworks/search/issues/new?labels=Question+%2F+Support\u0026template=3_Support_question.md).\n\n**Note:** Please be patient, it might take some time before your question is answered. **Do not ping the\nmaintainers.**\n\n## Contributing\n\nThis is an open source project. If you'd like to contribute,\nplease read the [Contributing Guidelines][2]. If you're submitting\na pull request, please follow the guidelines in the [Submitting a Patch][3] section.\n\n**Note:** RollerworksSearch is developed in a monolith repository, do not open pull request\nagainst repositories marked as `[READ-ONLY]`, thank you.\n\n[1]: https://getcomposer.org/doc/00-intro.md\n[2]: https://github.com/rollerworks/contributing\n[3]: https://contributing.readthedocs.org/en/latest/code/patches.html\n[4]: http://rollerworkssearch.readthedocs.org/en/latest/\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frollerworks%2Fsearch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frollerworks%2Fsearch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frollerworks%2Fsearch/lists"}