萨贾里/sajari-sdk-php

Search.io 提供了基于 Neuralsearch® 的搜索和发现服务,这是世界上第一种即时人工智能搜索技术。各种规模的企业都使用 Search.io 来构建网站搜索和发现解决方案,以最大化电子商务收入、优化网站客户体验并扩展其在线存在。

5.1.0 2022-05-04 08:26 UTC

README

Build status

这是官方的 Search.io PHP 客户端库。

Search.io 提供了基于 Neuralsearch® 的搜索和发现服务,这是世界上第一种即时人工智能搜索技术。各种规模的企业都使用 Search.io 来构建网站搜索和发现解决方案,以最大化电子商务收入、优化网站客户体验并扩展其在线存在。

目录

安装与使用

要求

PHP 7.2 及更高版本。

Composer

要通过 Composer 安装绑定,请将以下内容添加到 composer.json

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/sajari/sdk-php.git"
    }
  ],
  "require": {
    "sajari/sdk-php": "*@dev"
  }
}

然后运行 composer install

手动安装

下载文件并包含 autoload.php

<?php
require_once "/path/to/OpenAPIClient-php/vendor/autoload.php";

入门指南

请按照 安装过程 操作,然后运行以下命令

<?php
require_once __DIR__ . "/vendor/autoload.php";

// Configure HTTP basic authorization: BasicAuth
$config = Sajari\Configuration::getDefaultConfiguration()
  ->setUsername("YOUR_USERNAME")
  ->setPassword("YOUR_PASSWORD");

$apiInstance = new Sajari\Api\CollectionsApi(
  // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
  // This is optional, `GuzzleHttp\Client` will be used as default.
  new GuzzleHttp\Client(),
  $config
);
$collection_id = "collection_id_example"; // string | The ID to use for the collection.  This must start with an alphanumeric character followed by one or more alphanumeric or `-` characters. Strictly speaking, it must match the regular expression: `^[A-Za-z][A-Za-z0-9\\-]*$`.
$collection = new \Sajari\Model\Collection(); // \Sajari\Model\Collection | Details of the collection to create.
$account_id = "account_id_example"; // string | The account that owns the collection, e.g. `1618535966441231024`.

try {
  $result = $apiInstance->createCollection(
    $collection_id,
    $collection,
    $account_id
  );
  print_r($result);
} catch (Exception $e) {
  echo "Exception when calling CollectionsApi->createCollection: ",
    $e->getMessage(),
    PHP_EOL;
}

API 端点

所有 URI 都是相对于 https://api.search.io

模型

授权

基本认证

  • 类型:HTTP基本认证

测试

要运行测试,使用

composer install
vendor/bin/phpunit

作者

support@search.io

关于本包

此PHP包由OpenAPI Generator项目自动生成

  • API版本:v4
    • 包版本:5.1.0
  • 构建包:org.openapitools.codegen.languages.PhpClientCodegen