typesense/typesense-php
Composer 安装命令:
composer require typesense/typesense-php
包简介
PHP client for Typesense Search Server: https://github.com/typesense/typesense
README 文档
README
Official PHP client for the Typesense API: https://github.com/typesense/typesense
Installation
composer require php-http/curl-client typesense/typesense-php
You can also add typesense/typesense-php to your project's composer.json.
Typesense uses HTTPlug as an abstraction layer for an HTTP client. You'll find the List of supported HTTP clients & adapters here. Please be sure to install a supported client.
Usage
Read the documentation here: https://typesense.org/api/
Here are some examples that walk you through how to use the client: doc/examples
Escaping filter values
Use Typesense\FilterBy::escapeString() to safely use string values in filter_by:
use Typesense\FilterBy; $filterValue = "The 17\" O'Conner && O`Series \n OR a || 1%2 book? (draft), [alpha]"; $filterBy = 'tags:=' . FilterBy::escapeString($filterValue);
Compatibility
| Typesense Server | typesense-php |
|---|---|
| >= v30.0 | >= v6.0.0 |
| >= v28.0 | >= v5.0.0 |
| >= v26.0 | >= v4.9.0 |
| >= v0.23.0 | >= v4.8.0 |
| >= v0.21.0 | >= v4.7.0 |
| >= v0.20.0 | >= v4.6.0 |
| >= v0.19.0 | >= v4.5.0 |
| >= v0.18.0 | >= v4.4.0 |
| >= v0.17.0 | >= v4.2.0 |
| >= v0.16.0 | >= v4.1.0 |
| >= v0.15.0 | >= v4.0.0 |
Contributing
Bug reports and pull requests are welcome on GitHub at [https://github.com/typesense/typesense-php].
Development
Run linter:
composer run-script lint:fix
Run Typesense Server:
composer run-script typesenseServer
Run tests:
docker compose up
cp phpunit.xml.dist phpunit.xml
composer run-script test
Credits
This client was originally developed by Abdullah Al-Faqeir from DevLoops and was adopted as the official PHP client library for Typesense in Oct 2020.
Ongoing development and support is now provided by Typesense, in addition to our collaborators.
typesense/typesense-php 适用场景与选型建议
typesense/typesense-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7.07M 次下载、GitHub Stars 达 269, 最近一次更新时间为 2020 年 10 月 13 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 typesense/typesense-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 typesense/typesense-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 7.07M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 270
- 点击次数: 30
- 依赖项目数: 70
- 推荐数: 17
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2020-10-13