{"id":21433193,"url":"https://github.com/cdwv/sphinxsearchbundle","last_synced_at":"2025-07-14T13:30:43.981Z","repository":{"id":27600349,"uuid":"31083771","full_name":"cdwv/SphinxSearchBundle","owner":"cdwv","description":"Some SphinxSearch integration with Symfony","archived":false,"fork":false,"pushed_at":"2016-01-13T10:17:29.000Z","size":251,"stargazers_count":5,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-04T10:10:02.337Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cdwv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-20T20:29:18.000Z","updated_at":"2015-07-20T19:23:52.000Z","dependencies_parsed_at":"2022-09-14T02:31:24.781Z","dependency_job_id":null,"html_url":"https://github.com/cdwv/SphinxSearchBundle","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/cdwv/SphinxSearchBundle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdwv%2FSphinxSearchBundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdwv%2FSphinxSearchBundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdwv%2FSphinxSearchBundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdwv%2FSphinxSearchBundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cdwv","download_url":"https://codeload.github.com/cdwv/SphinxSearchBundle/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdwv%2FSphinxSearchBundle/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265297455,"owners_count":23742586,"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-22T23:26:24.724Z","updated_at":"2025-07-14T13:30:43.667Z","avatar_url":"https://github.com/cdwv.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SphinxSearchBundle\nSome SphinxSearch integration with Symfony for `gigablah/sphinxphp` and `foolz/sphinxql-query-builder`.\n![Alt text](/doc/images/profiler_error.png?raw=true \"Profiler with last error\")\n\n### Version 0.1.* was released during [Codewave's shipit day!](http://codewave.eu/shipit-days.html)\n\n# Installation\nInstall via composer:\n\n```sh\ncomposer require cdwv/sphinx-search-bundle\n```\n\n## QueryBuilder\n\nYou may register many connections. Example configuration is:\n\n```yml\nekiwok_sphinx:\n    connections:\n        default:\n            host: localhost\n            port: 9306\n            driver: pdo\n        remote:\n            host: remote-host\n            port: 9306\n            driver: mysqli\n```\n\nDefault connection with following configuration will always be created unless you provide alternative default configuration:\n\n```yml\nhost: localhost\nport: 9306\ndriver: pdo\n```\n\nIt means if you want to use pdo and you are running sphinx daemon on localhost on port 9306 you do not have to provide any configuration.\n\nPlease notice that `$this-\u003eget('sphinx')-\u003egetConnection()` is equivalent to `$this-\u003eget('sphinx')-\u003egetConnection('default')`.\n\nConnections returned by `sphinx` service implements `Ekiwok\\SphinxBundle\\Sphinx\\QL\\ConnectionInterface` that extends `Foolz\\SphinxQL\\Drivers\\ConnectionInterface` by `createQueryBuilder()` method so thay may be (and shoud be) used interchangeable with Foolz\\SphinxQL connections.\n\nExamples of usage:\n\n```yml\n$sphinx = $this-\u003eget('sphinx');\n$conn = $sphinx-\u003egetConnection();\n$recipes = $conn-\u003ecreateQueryBuilder()\n                -\u003eselect('id', 'title')\n                -\u003efrom('recipes')\n                -\u003ematch('title', 'chicken')\n                -\u003elimit(100)\n                -\u003eexecute();\n```\n\n```php\n$sphinx = $this-\u003eget('sphinx');\n$conn = $sphinx-\u003egetConnection();\n$recipes = $conn-\u003equery('SELECT id, title FROM recipes WHERE MATCH(\"(@title chicken)\")');\n```\n\nFor more please visit [https://github.com/FoolCode/SphinxQL-Query-Builder](https://github.com/FoolCode/SphinxQL-Query-Builder)\n\n## gigablah/sphinxphp\n\n### Fresh use\nIf you are just starting using sphinx in your project all you have to do is declare your default connection:\n\n```\n    sphinx.default.connection:\n        class: Sphinx\\SphinxClient\n        calls: \n            - [setServer, ['127.0.0.1', 9312] ]\n```\n\nNext decorate it with data collector:\n\n```\n    sphinx.default:\n        class: Ekiwok\\SphinxBundle\\Sphinx\\SphinxDataCollector\n        arguments: [@sphinx.default.connection, @sphinx_stats]\n```\n\n`@sphinx_stats` is service that provides data to profiler. You may implement your own provider by implementing: `Ekiwok\\SphinxBundle\\Sphinx\\SphinxDataCollector`\n\nNow use `sphinx.default` like `Sphinx\\SphinxClient`.\n\n` $sphinxClient = $this-\u003eget('sphinx.default'); `\n\n### Replacing Sphinx\\SphinxClient\n\n#### Symfony 2.5+\n\nIf you are using Symfony 2.5+ you may be interested in service decoration: http://symfony.com/doc/current/components/dependency_injection/advanced.html#decorating-services\n\n#### Replacing Sphinx\\SphinxClient\n\nIf you have your SphinxClient registered for example as `sphinx.default` use little hack, change this service name to `sphinx.default.connection`\nand register SphinxDataCollector as `sphinx.default`. Because SphinxDataCollector extends SphinxClient it shoud have no side effects on your project:\n\n```\n    sphinx.default:\n        class: Ekiwok\\SphinxBundle\\Sphinx\\SphinxDataCollector\n        arguments: [@sphinx.default.connection, @sphinx_stats]\n```\n\nYou can always instantiate SphinxDataCollector manually (for example in situation when you don't have your SphinxClient managed by container)\n\n```\n    // $sphinxClient is instance of Sphinx\\SphinxClient\n    $sphinxStats = $this-\u003eget('sphinx_stats');\n    $sphinxClient = new \\Ekiwok\\SphinxBundle\\Sphinx\\SphinxDataCollector($sphinxClient, $sphinxStats);\n```\n\n# What does this bundle do?\n\nWell, it shows fancy things and stuff in profiler and toolbar. Those things are now query calls and errors. So all it does is tracking calls of SphinxClient query method and measuring time of this method execution (yeah, it's not actuall query time).\n\nBecause SphinxClient uses binary protocol this bundle does not show real human readable queries that may be copied to sphinx cli. (Now =) Unfortunately, it shows just arguments (query, indexes and comment) passed to query method.\n\nThis bundle tracks all errors that unfold during executing queries.\n\n# Authors\nThis bundle was originally developed by [Piotr Kowalczyk](https://github.com/ekiwok) \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdwv%2Fsphinxsearchbundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcdwv%2Fsphinxsearchbundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdwv%2Fsphinxsearchbundle/lists"}