algoliasearch-client-php

algoliaMIT活跃维护

Algolia 官方 PHP 客户端,让 PHP 项目快速接入 Algolia 搜索服务,支持分面搜索、地理位置搜索和同义词配置等完整 API 能力。

⚡️ A fully-featured and blazing-fast PHP API client to interact with Algolia.

4.53.0发布于 2026-11-09 17:36 UTC695star112fork同步于 2026-11-10 05:59 UTC

怎么上手

README 里没有找到可直接复制的安装命令

README 里没有找到可直接复制的安装命令,请到 README 或官方文档查看安装方式。

硬件要求

README 没有说明硬件要求。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

这个项目的说明还在生成中,先参考下面「最近发版」和 README。

最近发版

5 个版本4.53.0
  1. 4.53.0最新正式版2026-11-09 · 2026-11-09 17:36 UTC

    New version released!

    What's Changed

    • e6933da012 fix(specs): clarify maxHitsPerQuery is a per-page limit (#7210) by @kai687
    • 0a3cbbb29b feat(specs): add per-feed params to Composition run request (#7199) by @ben-kalmus
    • 8456d9eb14 feat(specs): support algoliaDefined ordering in external sources (#7212) by @aiordache
    • b4fd39cda0 fix(php): make connection failures from timeouts in CurlHttpClient and GuzzleHttpClient (#7217) by @zigzagdev
    • 575c3ab5c6 fix(ci): move macOS jobs off the retired macos-14 runner label (#7224) by @Fluf22
    • 3e85edd42f docs(specs): describe the analytics no click rate per query (#7225) by @leonardogavaudan

    Full Changelog: https://github.com/algolia/algoliasearch-client-php/compare/4.51.0...4.53.0

    → Browse the Algolia documentation

  2. 4.51.02026-10-29 · 2026-10-29 09:21 UTC
    查看更新说明

    New version released!

    What's Changed

    • e6d5471f15 fix(scripts): avoid swift CTS deadlock when running in docker (#7146) by @Fluf22
    • c2153f09a5 fix(specs): remove obsolete index-key copy note (#7177) by @xroche
    • b45627b102 fix(php): send PATCH method and body in CurlHttpClient (#7191) by @zigzagdev
    • bd251f056e fix(php): stop truncating fractional timeouts in CurlHttpClient (#7192) by @zigzagdev
    • f312d66990 fix(php): retry every host when all of them are marked down (#7197) by @zigzagdev
    • 75e309924e clients(clients): cache host state only on change (#7202) by @zigzagdev
    • e7642ce951 feat(specs): add user metrics to abtesting-v3 timeseries enum (#7181) by @stevenMevans

    Full Changelog: https://github.com/algolia/algoliasearch-client-php/compare/4.50.0...4.51.0

    → Browse the Algolia documentation

  3. 4.50.02026-10-12 · 2026-10-12 15:18 UTC
    查看更新说明

    New version released!

    What's Changed

    BREAKING CHANGES: this minor version includes breaking changes (A/B Testing V3 API, PHP requirements, Agent Studio API). See below for more details.

    • 7891d38a10 feat(php): wait and retry on 429 with Retry-After (#6975) by @eric-zaharia
    • 812a3d1db6 chore(deps): dependencies 2026-09-14 (#7030) by @algolia-api-clients-automation-bot[bot]
    • 41ed59956a fix(specs): clarify when _extra and _injectedItemKey are present on hits (#7031) by @charlottetaylor-oss
    • 987444f36d fix(specs): clarify addItemKey description in injectedItem metadata (#7029) by @charlottetaylor-oss
    • f6a0478eec docs(specs): update analytics catalog entitlement example (#7028) by @cdhawke
    • 5da059b7ae feat(specs): add A/B test settings endpoints to abtesting-v3 (#6786) by @stevenMevans
    • f89fe94db5 fix(clients): send request bodies with Content-Length instead of chunked encoding (#7069) by @Fluf22
    • 461575c4a4 feat(specs): add A/B testing hypothesis (#6829) by @leonardogavaudan
    • b58c40832b fix(specs): BREAKING CHANGE - make AB test pValue optional (#7066) by @stevenMevans
      • pValue is now optional in the A/B test models. Update code that reads it as a required value.
    • 4cab83c8b1 feat(specs): add externalProvider source for CompAPI client (#7073) by @ClaraMuller
    • b6cd822bfb feat(specs): add resultCard to renderingContent widgets (#7084) by @FabienMotte
    • d59ce49d17 fix(clients): BREAKING CHANGE – always send Accept-Encoding gzip in Swift and require ext-zlib in PHP (#7086) by @Fluf22
      • The PHP client now requires the ext-zlib extension (added to composer.json). composer install or update fails on environments where it is missing.
    • 63c591d078 refactor(specs): extract source object from behaviour object (#7074) by @ClaraMuller
    • 2ae63dbdfc docs: improve AGENTS.md agent context (#7085) by @Fluf22
    • 07c1b2ea15 fix(specs): BREAKING CHANGE – sync agent-studio OpenAPI from conversational-ai (#6967) by @algolia-api-clients-automation-bot[b
  4. 4.49.02026-09-09 · 2026-09-09 15:35 UTC
    查看更新说明

    New version released!

    What's Changed

    BREAKING CHANGES: this minor version includes breaking changes in the A/B Testing V3 API. See below for more details.

    • 1b54a3d020 feat(php): Request-ID and Correlation-ID support (#6911) by @eric-zaharia
    • e4a6ab510a chore(ci): fail CI if a personal access token secret is referenced (#6919) by @eric-zaharia
    • 085364de00 feat(specs): deprecates /2 abtests endpoints (#6921) by @Niamsy
    • 28aa13de2e fix(clients): support guzzlehttp/psr7 v3 (#6945) by @eric-zaharia
    • b4c4109163 fix(specs): flag analytics patterns endpoints with x-beta (#6954) by @cdhawke
    • 8317b3a8ef feat(specs): BREAKING CHANGE – remove migratedAbTestID from abtesting-v3 (#6883) by @cdhawke

    Full Changelog: https://github.com/algolia/algoliasearch-client-php/compare/4.47.0...4.49.0

    → Browse the Algolia documentation

  5. 4.47.02026-08-18 · 2026-08-18 12:54 UTC
    查看更新说明

    New version released!

    What's Changed

    • b5880f18d0 fix(php): replace deprecated GuzzleHttp\choose_handler() (#6828) by @eric-zaharia
    • 3bee6d1dee chore(ci): pin all GitHub Action refs to commit SHAs (API-475) (#6819) by @MarioAlexandruDan
    • 1861c65242 fix(php): surface last retry error in UnreachableException (#6831) by @eric-zaharia
    • 1f389d1f7f feat(specs): add agentic analytics support to insights spec (#6876) by @sirockin
    • 65cc642811 feat(specs): add decision (declared winner) to abtesting-v3 ABTest (#6732) by @cdhawke
    • 637defc23a feat(specs): add analytics v3 pattern endpoints (#6795) by @Niamsy

    Full Changelog: https://github.com/algolia/algoliasearch-client-php/compare/4.46.3...4.47.0

    → Browse the Algolia documentation

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    ✨ Features

    • Thin & minimal low-level HTTP client to interact with Algolia's API
    • Supports php ^8.0.

    💡 Getting Started

    First, install Algolia PHP API Client via the composer package manager:

    composer require algolia/algoliasearch-client-php "^4.0"
    

    You can now import the Algolia API client in your project and play with it.

    use Algolia\AlgoliaSearch\Api\SearchClient;
    
    $client = SearchClient::create('<YOUR_APP_ID>', '<YOUR_API_KEY>');
    
    // Add a new record to your Algolia index
    $response = $client->saveObject(
        '<YOUR_INDEX_NAME>',
        ['objectID' => 'id',
            'test' => 'val',
        ],
    );
    
    // play with the response
    var_dump($response);
    
    // Poll the task status to know when it has been indexed
    $client->waitForTask('<YOUR_INDEX_NAME>', $response['taskID']);
    
    // Fetch search results, with typo tolerance
    $response = $client->search(
        ['requests' => [
            ['indexName' => '<YOUR_INDEX_NAME>',
                'query' => '<YOUR_QUERY>',
                'hitsPerPage' => 50,
            ],
        ],
        ],
    );
    
    // play with the response
    var_dump($response);
    

    For full documentation, visit the Algolia PHP API Client.

    ❓ Troubleshooting

    Encountering an issue? Before reaching out to support, we recommend heading to our FAQ where you will find answers for the most common issues and gotchas with the client. You can also open a GitHub issue

    Contributing

    This repository hosts the code of the generated Algolia API client for PHP, if you'd like to contribute, head over to the main repository. You can also find contributing guides on our documentation website.

    📄 License

    The Algolia PHP API Client is an open-sourced software licensed under the MIT license.