{"id":20528239,"url":"https://github.com/manticoresoftware/manticoresearch-php","last_synced_at":"2025-04-13T07:48:03.522Z","repository":{"id":37086684,"uuid":"235329798","full_name":"manticoresoftware/manticoresearch-php","owner":"manticoresoftware","description":"Official PHP client for Manticore Search","archived":false,"fork":false,"pushed_at":"2025-04-01T13:50:32.000Z","size":1652,"stargazers_count":182,"open_issues_count":18,"forks_count":33,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-04-13T07:47:55.290Z","etag":null,"topics":["php","search"],"latest_commit_sha":null,"homepage":null,"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/manticoresoftware.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":"2020-01-21T11:46:19.000Z","updated_at":"2025-04-09T09:41:48.000Z","dependencies_parsed_at":"2023-12-21T19:14:26.763Z","dependency_job_id":"375df5b3-7ec6-440c-8d0a-5dd8dd865287","html_url":"https://github.com/manticoresoftware/manticoresearch-php","commit_stats":{"total_commits":232,"total_committers":12,"mean_commits":"19.333333333333332","dds":"0.39655172413793105","last_synced_commit":"be1bc3d779dcf85c2d1c04a6fcc95e42eceacb00"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manticoresoftware%2Fmanticoresearch-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manticoresoftware%2Fmanticoresearch-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manticoresoftware%2Fmanticoresearch-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manticoresoftware%2Fmanticoresearch-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/manticoresoftware","download_url":"https://codeload.github.com/manticoresoftware/manticoresearch-php/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248681494,"owners_count":21144700,"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":["php","search"],"created_at":"2024-11-15T23:24:09.265Z","updated_at":"2025-04-13T07:48:03.488Z","avatar_url":"https://github.com/manticoresoftware.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"manticoresearch-php\n===================\n![Build Status](https://github.com/manticoresoftware/manticoresearch-php/actions/workflows/ci.yml/badge.svg)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/manticoresoftware/manticoresearch-php/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/manticoresoftware/manticoresearch-php/?branch=master)\n[![codecov.io](https://codecov.io/github/manticoresoftware/manticoresearch-php/coverage.svg)](https://codecov.io/github/manticoresoftware/manticoresearch-php)\n[![Latest Stable Version](https://poser.pugx.org/manticoresoftware/manticoresearch-php/v/stable)](https://packagist.org/packages/manticoresoftware/manticoresearch-php)\n[![License](https://poser.pugx.org/manticoresoftware/manticoresearch-php/license)](https://packagist.org/packages/manticoresoftware/manticoresearch-php)\n[![Slack][slack-badge]][slack-url]\n\n[![Total Downloads](https://poser.pugx.org/manticoresoftware/manticoresearch-php/downloads)](https://packagist.org/packages/manticoresoftware/manticoresearch-php)\n[![Monthly Downloads](https://poser.pugx.org/manticoresoftware/manticoresearch-php/d/monthly)](https://packagist.org/packages/manticoresoftware/manticoresearch-php)\n[![Daily Downloads](https://poser.pugx.org/manticoresoftware/manticoresearch-php/d/daily)](https://packagist.org/packages/manticoresoftware/manticoresearch-php)\n[![composer.lock](https://poser.pugx.org/manticoresoftware/manticoresearch-php/composerlock)](https://packagist.org/packages/manticoresoftware/manticoresearch-php)\n\n[![GitHub Code Size](https://img.shields.io/github/languages/code-size/manticoresoftware/manticoresearch-php)](https://github.com/manticoresoftware/manticoresearch-php)\n[![GitHub Repo Size](https://img.shields.io/github/repo-size/manticoresoftware/manticoresearch-php)](https://github.com/manticoresoftware/manticoresearch-php)\n[![GitHub Last Commit](https://img.shields.io/github/last-commit/manticoresoftware/manticoresearch-php)](https://github.com/manticoresoftware/manticoresearch-php)\n[![GitHub Activity](https://img.shields.io/github/commit-activity/m/manticoresoftware/manticoresearch-php)](https://github.com/manticoresoftware/manticoresearch-php)\n[![GitHub Issues](https://img.shields.io/github/issues/manticoresoftware/manticoresearch-php)](https://github.com/manticoresoftware/manticoresearch-php/issues)\n\n\nOfficial PHP client for Manticore Search.\n\n❗ WARNING: this is a development version of the client. The latest release's readme is https://github.com/manticoresoftware/manticoresearch-php/tree/4.0.1\n\n\nFeatures\n--------\n- One to one mapping with the HTTP API\n- connection pools with pluggable selection strategy. Defaults to static round robin\n- pluggable PSR/Log interface\n- pluggable transport protocols.\n- persistent connections\n\n\nRequirements\n------------\n\nRequires PHP 7.1 or greater with the native JSON extension. Default transport handler uses the cURL extension.\n\nMinimum Manticore Search version is 2.5.1 with HTTP protocol enabled.\n\n| Manticore Search  | manticoresearch-php |     PHP       |\n| ----------------- | ------------------- | ------------- |\n| \u003e= 7.0.0          | 4.0.x               | \u003e= 7.4, \u003e=8.0 |\n| \u003e= 6.3.6          | 3.2.x               | \u003e= 7.4, \u003e=8.0 |\n| \u003e= 6.2.0          | 3.1.x               | \u003e= 7.4, \u003e=8.0 |\n| \u003e= 6.2.0          | 3.0.x               | \u003e= 7.4, \u003e=8.0 |\n| \u003e= 6.0.4          | 3.0.x               | \u003e= 7.1, \u003e=8.0 |\n| \u003e= 4.2.1          | 2.0.x, 2.1.x, 2.2.x | \u003e= 7.1, \u003e=8.0 |\n| \u003e= 4.0.2          | 1.7.x, 1.8.x        | \u003e= 7.1, \u003e=8.0 |\n| \u003e= 3.5.2          | 1.6.x               | \u003e= 7.1, \u003e=8.0 |\n| \u003e= 3.5.0          | 1.5.x               | \u003e= 7.1, \u003c8.0  |\n| \u003e= 3.5.0          | 1.4                 | \u003e= 7.1, \u003c8.0  |\n| \u003c= 3.4.x          | 1.3                 | \u003e= 7.1, \u003c8.0  |\n| \u003e= 2.5.1, \u003c3.4.0  | 1.2                 | \u003e= 7.1, \u003c8.0  |\n\nDocumentation\n-------------\n\nFull documentation is available in  [docs](docs) folder.\n\n\n\nManticore Search server documentation: https://manual.manticoresearch.com/.\n\n\nGetting Started\n---------------\n\nInstall the Manticore Search PHP client using [composer](https://getcomposer.org) package manager:\n\n```bash\ncomposer require manticoresoftware/manticoresearch-php:dev-master\n```\n### Initiate a table:\n\n```php\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$config = ['host'=\u003e'127.0.0.1','port'=\u003e9308];\n$client = new \\Manticoresearch\\Client($config);\n$table = $client-\u003etable('movies');\n```\n\n### Create the table:\n\n```php\n$table-\u003ecreate([\n    'title'=\u003e['type'=\u003e'text'],\n    'plot'=\u003e['type'=\u003e'text'],\n    '_year'=\u003e['type'=\u003e'integer'],\n    'rating'=\u003e['type'=\u003e'float']\n    ]);\n```\n\n### Add a document:\n\n```php\n$table-\u003eaddDocument([\n        'title' =\u003e 'Star Trek: Nemesis',\n        'plot' =\u003e 'The Enterprise is diverted to the Romulan homeworld Romulus, supposedly because they want to negotiate a peace treaty. Captain Picard and his crew discover a serious threat to the Federation once Praetor Shinzon plans to attack Earth.',\n        '_year' =\u003e 2002,\n        'rating' =\u003e 6.4\n        ],\n    1);\n```\n\n### Add several documents at once:\n\n```php\n$table-\u003eaddDocuments([\n        ['id'=\u003e2,'title'=\u003e'Interstellar','plot'=\u003e'A team of explorers travel through a wormhole in space in an attempt to ensure humanity\\'s survival.','_year'=\u003e2014,'rating'=\u003e8.5],\n        ['id'=\u003e3,'title'=\u003e'Inception','plot'=\u003e'A thief who steals corporate secrets through the use of dream-sharing technology is given the inverse task of planting an idea into the mind of a C.E.O.','_year'=\u003e2010,'rating'=\u003e8.8],\n        ['id'=\u003e4,'title'=\u003e'1917 ','plot'=\u003e' As a regiment assembles to wage war deep in enemy territory, two soldiers are assigned to race against time and deliver a message that will stop 1,600 men from walking straight into a deadly trap.','_year'=\u003e2018,'rating'=\u003e8.4],\n        ['id'=\u003e5,'title'=\u003e'Alien','plot'=\u003e' After a space merchant vessel receives an unknown transmission as a distress call, one of the team\\'s member is attacked by a mysterious life form and they soon realize that its life cycle has merely begun.','_year'=\u003e1979,'rating'=\u003e8.4]\n    ]); \n```\n\n### Perform a search:\n\n```php\n\n$results = $table-\u003esearch('space team')-\u003eget();\n\nforeach($results as $doc) {\n   echo 'Document:'.$doc-\u003egetId().\"\\n\";\n   foreach($doc-\u003egetData() as $field=\u003e$value)\n   {   \n        echo $field.\": \".$value.\"\\n\";\n   }\n}\n```\nResult:\n```\nDocument:2\nyear: 2014\nrating: 8.5\ntitle: Interstellar\nplot: A team of explorers travel through a wormhole in space in an attempt to ensure humanity's survival.\n\n```\nA text search with attribute filters:\n\n```php\n\n$results = $table-\u003esearch('space team')\n                 -\u003efilter('_year','gte',2000)\n                 -\u003efilter('rating','gte',8.0)\n                 -\u003esort('_year','desc')\n                 -\u003eget();\n\nforeach($results as $doc) {\n    echo 'Document:'.$doc-\u003egetId().\"\\n\";\n    foreach($doc-\u003egetData() as $field=\u003e$value)\n    {   \n        echo $field.\": \".$value.\"\\n\";\n    }\n}\n```\n\n\n\n### Update documents:\n\nBy document id:\n\n```php\n$table-\u003eupdateDocument(['_year'=\u003e2019],4);\n\n```\n\nBy query:\n\n```php\n$table-\u003eupdateDocument(['_year'=\u003e2019],['match'=\u003e['*'=\u003e'team']]);\n\n```\n\n\n### Get table schema:\n```php\n$table-\u003edescribe();\n```\n\n### Drop table:\n\n```php\n$table-\u003edrop();\n```\n\nThe above will fail if the table does not exist.  To get around this pass a parameter of true, which cause the failure\nto be silent.\n\n```php\n$table-\u003edrop(true);\n```\n\n\n\n\nLicense\n-------\nManticore Search PHP Client is an open-source software licensed under the [MIT license](LICENSE.txt)\n\n\n[slack-url]: https://slack.manticoresearch.com/\n[slack-badge]:  https://img.shields.io/badge/Slack-join%20chat-green.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanticoresoftware%2Fmanticoresearch-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmanticoresoftware%2Fmanticoresearch-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanticoresoftware%2Fmanticoresearch-php/lists"}