callwoola/search-suggest

Search suggest , search auto complete

1.3.6 2016-10-17 10:17 UTC

README

Packagist Build Status

功能说明

  • 把句子分词后缓存转换成拼音缓存
  • 把句子分词后缓存
  • 当你输入英文 或者中文的时候,可以从缓存里获取匹配值返回

使用

code:

创建索引

$suggest = new Suggest;
$result = $suggest->push([
	'name' => 'untitle',
	'data' => [
		...
	]
]);

搜索

$suggest = new Suggest;
$result = $suggest->search('word');

Usage

在composer.json文件中 requird 项中添加

"Callwoola/search-suggest": "1.3.1"

更新项目依赖

composer update -v

在app/config/app.php中 providers 项中添加这一项

'Callwoola\SearchSuggest\Provider\SearchProvider',

在app/config/app.php中 aliases 项中添加别名

'SearchSuggest' => 'Callwoola\SearchSuggest\Provider\Facades\Suggest',

在config的 database.php 配置

    'suggest' => [
        'database' => {{redis_database_number}}
    ],

frontend

前端框架

link(基于jQuery的自动提示插件)

License

for Free