sw-fw-less
  • sw-fw-less
  • get started
    • Installation
    • Directory
    • Config
    • Quick Start
  • MVC
    • Router
    • Middleware
    • Request
    • Param Validator
    • Model
    • Response
  • Database
    • MySQL
    • Redis
    • Elasticsearch
  • Storage
    • General
    • File
    • Qiniu
    • Alioss
  • OTHER
    • Pagination
    • Helper
    • Error Handler
    • AMQP-0-9-1
    • Events
  • Deployment
    • Nginx
    • Docker
  • APPENDIX
    • Development Rules
Powered by GitBook
On this page
  • Config Example
  • Search
  • Get
  • Create Index
  • Add Doc

Was this helpful?

  1. Database

Elasticsearch

Config Example

'elasticsearch' => [
    'connections' => [
        'default' => [
            'hosts' => [
                \App\components\Helper::env('ES_DEFAULT_HOST', '127.0.0.1:9200'),
            ], // ES Cluster Hosts
            'timeout' => \App\components\Helper::envDouble('ES_TIMEOUT', 1), // HTTP Request Timeout during rest api call
        ],
    ],
    'switch' => \App\components\Helper::envInt('ES_SWITCH', 0),
],

Search

Get

Create Index

Add Doc

PreviousRedisNextGeneral

Last updated 6 years ago

Was this helpful?