ronte-ltd/elastic-bundle

用于弹性搜索服务的包

dev-master 2016-12-15 14:16 UTC

This package is not auto-updated.

Last update: 2024-09-14 19:20:22 UTC


README

安装

Composer

composer require ronte-ltd/elastic-bundle

AppKernel.php

new RonteLtd\ElasticBundle\RonteLtdElasticBundle()

config.yml

ronte_ltd_elastic:
    entities:
        AppBundle\Entity\Entity: "%kernel.root_dir%/../src/AppBundle/Resources/schema/entity.yml"
    hosts:
        - 'http://127.0.0.1:9200'

上面entity.yml的实体模式示例

index: 'items'
type: 'item'
settings:
    number_of_shards: 3
    number_of_replicas: 2
mappings:
    _source:
        enabled: true
    properties:
        id:
            type: 'integer'
        name:
            type: 'string'
            analyzer: 'standard'
        nickname:
            type: 'string'
            analyzer: 'standard'

路线图

  • Doctrine事件的监听器
  • 弹性服务
  • 测试