Laravel5.6/vue/scout/elasticserach6.4/scout-Elasticsearch-driver 搜索 demo

前言

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

功能

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

安装

github地址:https://github.com/yb19890724/laravel-es

   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

本作品采用《CC 协议》,转载必须注明作者和本文链接
yourself
《L01 基础入门》
我们将带你从零开发一个项目并部署到线上,本课程教授 Web 开发中专业、实用的技能,如 Git 工作流、Laravel Mix 前端工作流等。
《G01 Go 实战入门》
从零开始带你一步步开发一个 Go 博客项目,让你在最短的时间内学会使用 Go 进行编码。项目结构很大程度上参考了 Laravel。
讨论数量: 4

兄弟能提供下源码嘛?最近也在学ES

5年前 评论
yourself

@fanfan 忘了放了 额````

5年前 评论
yourself

@fanfan 已经加上了

5年前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!