{"id":18345722,"url":"https://github.com/hyperf/qdrant-client","last_synced_at":"2025-04-06T08:31:48.146Z","repository":{"id":183221396,"uuid":"668888684","full_name":"hyperf/qdrant-client","owner":"hyperf","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-01T14:11:55.000Z","size":46,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-01T15:27:58.139Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hyperf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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},"funding":{"open_collective":"hyperf","custom":"https://hyperf.wiki/#/zh-cn/donate"}},"created_at":"2023-07-20T20:45:54.000Z","updated_at":"2025-04-01T14:09:42.000Z","dependencies_parsed_at":"2023-07-23T14:02:33.444Z","dependency_job_id":"32e15aab-0e7a-471b-84d7-f48a6f7bd0fb","html_url":"https://github.com/hyperf/qdrant-client","commit_stats":null,"previous_names":["hyperf/qdrant-client"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperf%2Fqdrant-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperf%2Fqdrant-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperf%2Fqdrant-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperf%2Fqdrant-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hyperf","download_url":"https://codeload.github.com/hyperf/qdrant-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247457302,"owners_count":20941900,"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-05T21:09:17.206Z","updated_at":"2025-04-06T08:31:47.880Z","avatar_url":"https://github.com/hyperf.png","language":"PHP","readme":"# Hyperf Qdrant Client\n\n## Install\n```bash\ncomposer require hyperf/qdrant-client\n```\n\n## Usage\n\nAn example to create a collection:\n```php\nuse App\\VectorStore\\Qdrant\\Config;\nuse Hyperf\\Qdrant\\Api\\Collections;\nuse Hyperf\\Qdrant\\Api\\Points;\nuse Hyperf\\Qdrant\\Connection\\HttpClient;\nuse Hyperf\\Qdrant\\Struct\\Collections\\Enums\\Distance;\nuse Hyperf\\Qdrant\\Struct\\Collections\\VectorParams;\nuse Hyperf\\Qdrant\\Struct\\Points\\ExtendedPointId;\nuse Hyperf\\Qdrant\\Struct\\Points\\Point\\PointStruct;\nuse Hyperf\\Qdrant\\Struct\\Points\\SearchCondition\\FieldCondition;\nuse Hyperf\\Qdrant\\Struct\\Points\\SearchCondition\\Filter;\nuse Hyperf\\Qdrant\\Struct\\Points\\SearchCondition\\Match\\MatchValue;\nuse Hyperf\\Qdrant\\Struct\\Points\\VectorStruct;\n\n$client = new HttpClient(new Config(...));\n\n$collections = new Collections($client);\n$collections-\u003ecreateCollection('test_collection', new VectorParams(1536, Distance::COSINE));\n\n# insert vector data\n$points = new Points($client);\n$points-\u003esetWait(true);\n$points-\u003eupsertPoints('test_collection', [\n    new PointStruct(\n        new ExtendedPointId($key + 10000),\n        new VectorStruct($data['embeddings'][0]),\n        [\n            # payload\n            'name' =\u003e $data['name'],\n            'description' =\u003e $data['description'],\n            'image' =\u003e $data['image'],\n        ],\n    ),\n]);\n\n# similarity search\n$result = $points-\u003esearchPoints(\n    'test_collection',\n    new VectorStruct($data['embeddings'][0]),\n    3,\n    withPayload: new WithPayload(true),\n);\nprint_r($result);\n\n# payload filter\n$result = $points-\u003esearchPoints(\n    'test_collection',\n    new VectorStruct($data['embeddings'][0]),\n    3,\n    new Filter(\n        must: [\n            new FieldCondition('name', new MatchValue('qdrant')),\n        ]\n    ),\n    withPayload: new WithPayload(true),\n);\nprint_r($result);\n```","funding_links":["https://opencollective.com/hyperf","https://hyperf.wiki/#/zh-cn/donate"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyperf%2Fqdrant-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhyperf%2Fqdrant-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyperf%2Fqdrant-client/lists"}