定制 sajari/sajari-sdk-php 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

sajari/sajari-sdk-php

Composer 安装命令:

composer require sajari/sajari-sdk-php

包简介

Search.io offers a search and discovery service with Neuralsearch®, the world's first instant AI search technology. Businesses of all sizes use Search.io to build site search and discovery solutions that maximize e-commerce revenue, optimize on-site customer experience, and scale their online presen

README 文档

README

Build status

The official Search.io PHP client library.

Search.io offers a search and discovery service with Neuralsearch®, the world's first instant AI search technology. Businesses of all sizes use Search.io to build site search and discovery solutions that maximize e-commerce revenue, optimize on-site customer experience, and scale their online presence.

Table of contents

Installation & usage

Requirements

PHP 7.2 and later.

Composer

To install the bindings via Composer, add the following to composer.json:

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

Then run composer install

Manual installation

Download the files and include autoload.php:

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

Getting started

Please follow the installation procedure and then run the following:

<?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 endpoints

All URIs are relative to https://api.search.io

Class Method HTTP request Description
CollectionsApi createCollection POST /v4/collections Create collection
CollectionsApi deleteCollection DELETE /v4/collections/{collection_id} Delete collection
CollectionsApi experiment POST /v4/collections/{collection_id}:experiment Experiment
CollectionsApi getCollection GET /v4/collections/{collection_id} Get collection
CollectionsApi listCollections GET /v4/collections List collections
CollectionsApi queryCollection POST /v4/collections/{collection_id}:query Query collection
CollectionsApi queryCollection2 POST /v4/collections/{collection_id}:queryCollection Query collection
CollectionsApi trackEvent POST /v4/collections/{collection_id}:trackEvent Track event
CollectionsApi updateCollection PATCH /v4/collections/{collection_id} Update collection
EventsApi sendEvent POST /v4/events:send Send event
EventsApi sendEvent2 POST /v4/events:sendEvent Send event
PipelinesApi createPipeline POST /v4/collections/{collection_id}/pipelines Create pipeline
PipelinesApi generatePipelines POST /v4/collections/{collection_id}:generatePipelines Generate pipelines
PipelinesApi getDefaultPipeline GET /v4/collections/{collection_id}:getDefaultPipeline Get default pipeline
PipelinesApi getDefaultVersion GET /v4/collections/{collection_id}/pipelines/{type}/{name}:getDefaultVersion Get default pipeline version
PipelinesApi getPipeline GET /v4/collections/{collection_id}/pipelines/{type}/{name}/{version} Get pipeline
PipelinesApi listPipelines GET /v4/collections/{collection_id}/pipelines List pipelines
PipelinesApi setDefaultPipeline POST /v4/collections/{collection_id}:setDefaultPipeline Set default pipeline
PipelinesApi setDefaultVersion POST /v4/collections/{collection_id}/pipelines/{type}/{name}:setDefaultVersion Set default pipeline version
PromotionsApi createPromotion POST /v4/collections/{collection_id}/promotions Create promotion
PromotionsApi deletePromotion DELETE /v4/collections/{collection_id}/promotions/{promotion_id} Delete promotion
PromotionsApi getPromotion GET /v4/collections/{collection_id}/promotions/{promotion_id} Get promotion
PromotionsApi listPromotions GET /v4/collections/{collection_id}/promotions List promotions
PromotionsApi updatePromotion PATCH /v4/collections/{collection_id}/promotions/{promotion_id} Update promotion
RecordsApi batchUpdateRecords POST /v4/collections/{collection_id}/records:batchUpdate Batch update records
RecordsApi batchUpsertRecords POST /v4/collections/{collection_id}/records:batchUpsert Batch upsert records
RecordsApi deleteRecord POST /v4/collections/{collection_id}/records:delete Delete record
RecordsApi getRecord POST /v4/collections/{collection_id}/records:get Get record
RecordsApi updateRecord POST /v4/collections/{collection_id}/records:update Update record
RecordsApi upsertRecord POST /v4/collections/{collection_id}/records:upsert Upsert record
RedirectsApi createRedirect POST /v4/collections/{collection_id}/redirects Create redirect
RedirectsApi deleteRedirect DELETE /v4/collections/{collection_id}/redirects/{redirect_id} Delete redirect
RedirectsApi getRedirect GET /v4/collections/{collection_id}/redirects/{redirect_id} Get redirect
RedirectsApi listRedirects GET /v4/collections/{collection_id}/redirects List redirects
RedirectsApi updateRedirect PATCH /v4/collections/{collection_id}/redirects/{redirect_id} Update redirect
SchemaApi batchCreateSchemaFields POST /v4/collections/{collection_id}/schemaFields:batchCreate Batch create schema fields
SchemaApi createSchemaField POST /v4/collections/{collection_id}/schemaFields Create schema field
SchemaApi deleteSchemaField DELETE /v4/collections/{collection_id}/schemaFields/{schema_field_name} Delete schema field
SchemaApi listSchemaFields GET /v4/collections/{collection_id}/schemaFields List schema fields
SchemaApi updateSchemaField PATCH /v4/collections/{collection_id}/schemaFields/{schema_field_name} Update schema field

Models

Authorization

BasicAuth

  • Type: HTTP basic authentication

Tests

To run the tests, use:

composer install
vendor/bin/phpunit

Author

support@search.io

About this package

This PHP package is automatically generated by the OpenAPI Generator project:

  • API version: v4
    • Package version: 5.1.0
  • Build package: org.openapitools.codegen.languages.PhpClientCodegen

sajari/sajari-sdk-php 适用场景与选型建议

sajari/sajari-sdk-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 37.28k 次下载、GitHub Stars 达 8, 最近一次更新时间为 2015 年 02 月 03 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「php」 「rest」 「api」 「search」 「sdk」 「sajari」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 sajari/sajari-sdk-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 sajari/sajari-sdk-php 我们能提供哪些服务?
定制开发 / 二次开发

基于 sajari/sajari-sdk-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 37.28k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 8
  • 点击次数: 23
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 8
  • Watchers: 6
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-02-03