Download the PHP package wangzd/laravel-elasticsearch without Composer
On this page you can find all versions of the php package wangzd/laravel-elasticsearch. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package laravel-elasticsearch
laravel-elasticsearch
介绍
为 Laravel Scout 开发的 Elasticsearch 驱动;
为了方便大家测试,搭建了一个带分词的elasticsearch docker
安装
- Laravel 5.5 以下,
config/app.php
中添加service provider
3.发布配置项;
bash php artisan vendor:publish --provider="Laravel\Scout\ScoutServiceProvider"
'elasticsearch' => [
'hosts' => [
env('ELASTICSEARCH_HOST', 'http://localhost'),
],
'analyzer' => env('ELASTICSEARCH_ANALYZER', 'ik_max_word'),
'settings' => [],
'filter' => [
]
],
bash
SCOUT_DRIVER=elasticsearch
SCOUT_PREFIX=local
#elasticsearch
ELASTICSEARCH_HOST=127.0.0.1:9200
ELASTICSEARCH_INDEX=shop_test
namespace App\Models;
use Illuminate\Database\Eloquent\Model; use Laravel\Scout\Searchable;
class ShopSearchModel extends Model { use Searchable; /**
-
数据表名 */ protected $table = "shop_search";
/**
-
主键 */ protected $primaryKey = "goods_id"; }
php artisan scout:import "App\Models\ShopSearchModel"
7.执行搜索
All versions of laravel-elasticsearch with dependencies
PHP Build Version
Package Version
The package wangzd/laravel-elasticsearch contains the following files
Loading the files please wait ....