Skip to content

draguo/opensearch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

阿里云 opensearch

配置

$config = [
    'app_id' => '', // 应用id
    'secret' => '', // 应用密钥
    'app_name' => '', // 应用名
    'suggest_name' => '', // 搜索名
    'host' => 'http://opensearch-cn-beijing.aliyuncs.com', // 主机地址
];
$app = new Opensearch($config);

下拉提示

// String $query 搜索词
// int $hit 限制返回数量
$result = $search->suggest($query, $hit);