承接 adimeo-data-suite/php-client 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

adimeo-data-suite/php-client

最新稳定版本:2.2.3

Composer 安装命令:

composer require adimeo-data-suite/php-client

包简介

README 文档

README

Installation

The most efficient way to install ADS Search Client is using Composer:

composer require adimeo-data-suite/php-client

Usage

Initialisation

You must first instantiate an AdsClient object, passing to its constructor some base configuration related to your ADS server:

$searchClient = new AdsClient('http://ads.base.url', 'index.mapping', 'analyzer');

This code is sufficient for the client to perform a request on the server, given that the client will grab search context from the query string by default.

The query string parameters expected by the client are:

Parameter Description
query Elastic style query terms
from Record index in the resultset
size Number of records returned (to paginate)
sort Field to sort results on (e.g. field,ASC or field,DESC)
filter Results filters (documentation to come)
facetOptions Facet options (documentation to come)

Please note that AdsClient will usually generate required parameters for you. This will be explained later.

Search

To actually search the index, just call the search() method:

$result = $searchClient->search();

Adding facets

Facets are one of the most valuable feature of a search engine compared to database search! Adding a facet to your resultset is quite straightforward:

$searchClient->addFacet(new Facet('field.raw'));

Note: field must not be tokenized to be available as facet. If it is, please also keep raw data in the index and refer to field.raw instead of field (like in the example above) to set your facet up.

Redering example

Look at the example(s) folder to see actual sample code.

To add a sticky facet, just set the matching flag on the facet:

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2019-04-29