Skip to content

yb19890724/laravel-es

Repository files navigation

前言

这个小项目主要是为了学习elasticsearch Api,前端非常简单,因为重心不在前端。主要实现功能为主,代码没有过多的优化。给大家提供了简单的数据,后期不定期维护,开发过程中遇到个小插曲。

功能

简单搜索,嵌套搜索,定位功能,聚合操作。

安装

   composer update 

执行命令

  • 简单方式
php artisan laraveles
  • 按步骤来
php artisan migrate 
php artisan elastic:create-index App\Es\Index\ProductIndexConfigurator 
php artisan elastic:create-index App\Es\Index\CategoryIndexConfigurator
php artisan elastic:create-index App\Es\Index\ShopIndexConfigurator
php artisan migrate
php artisan db:seed
  • 安装js扩展
npm install
npm run dev

修改配置 .env

DB_HOST=  
DB_PORT=  
DB_DATABASE=
DB_USERNAME=
DB_PASSWORD=
SCOUT_DRIVER=elastic                   #scout驱动
SCOUT_ELASTIC_HOST=localhost:9200      #es host

界面

访问:yourhost/dashboard

1p pto q x9uqr jt o ipu

1536286882 1

1536286894 1

1536286916 1

1536286933 1

About

laravel mongodb elasticsearch

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published