logshub/search-client-php 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

logshub/search-client-php

Composer 安装命令:

composer require logshub/search-client-php

包简介

README 文档

README

You can use it to manage your search services. This is main connector between your store and logshub.com search service. Most of the stores are written in PHP language, and we decided to create this connector to speed up integration.

Requirements

Installation

composer require logshub/search-client-php

Test

make test

Example

<?php
include_once 'vendor/autoload.php';

# you can find your service's details on your logshub.com dashboard.
$location = 'uk01';
$serviceId = '5b5a06d2-23bc-4186-4d1b-3a17bfa7200d';
$apihash = 'xizinISDPH';
$apiSecret = 'ZJLnvZAujIBOTiJVyfImZYLEKdesJPKUntfFztYLiefQsCMgmd';
$client = \Logshub\SearchClient\Client::fromLocation(
   $location, $apihash, $apiSecret);

$product = new \Logshub\SearchClient\Model\Product('1', [
   'name' => 'Laptop Full HD 8GB RAM',
   'price' => 899
]);
$request = new \Logshub\SearchClient\Request\IndexProducts($serviceId, [
   $product
]);
$response = $client->indexProducts($request);

echo $response->getBody() . PHP_EOL;

More info at the documentation.

Demo usage

Content of config file, required for demo

# example content of /etc/logshub-search.ini - replace with your details,
# that can be found on your logshub's service details page
serviceid = "5b5a06d2-23bc-4186-4d1b-3a17bfa7200d"
location = "uk01"
apihash = "xizinISDPH"
apisecret = "ZJLnvZAujIBOTiJVyfImZYLEKdesJPKUntfFztYLiefQsCMgmd"

Indexing

php vendor/bin/logshub-search index \
--config /etc/logshub-search.ini \
--id 4 \
--name "Laptop for gaming asus" \
--price 15.5

Searching

php vendor/bin/logshub-search search \
--config /etc/logshub-search.ini \
--query "laptop"

Indexing CSV file

php vendor/bin/logshub-search index:csv \
--config /etc/logshub-search.ini \
--csv /home/greg/products.csv

Licence

MIT

统计信息

  • 总下载量: 53
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2019-01-31

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固