百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
E

ElasticsearchBundle

> 数据库
开源

带有强化功能的 Elasticsearch Symfony 组件

313 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

带有强化功能的 Elasticsearch Symfony 组件

ONGR Elasticsearch Bundle

Elasticsearch Bundle was created in order to serve the need for professional Elasticsearch integration with enterprise level Symfony applications. This bundle is:

  • Uses the official elasticsearch-php client.
  • Ensures full integration with Symfony framework and Symfony Flex.

Technical goodies:

  • Provides a DSL query builder which represent all ElasticSearch endpoints in the objective way.
  • Provides interactive Document object generator via CLI command (ongr:es:document:generate)
  • Creates a familiar Doctrine-like way to work with documents(entities) document-object mapping using annotations.
  • Several query results iterators are provided for your convenience to work with results.
  • Console CLI commands for the index management and data import/export/reindex.
  • Profiler that integrates in the Symfony debug bar and shows all executed queries.
  • Designed in an extensible way for all your custom needs.
  • Supports Symfony FLEX.

If you need any help, stack overflow is the preferred way to get answers. is the preferred and recommended way to ask questions about ONGR bundles and libraries.

If you like this library, help me to develop it by buying a cup of coffee

Version matrix

Elasticsearch version ElasticsearchBundle version
>= 7.0 ~7.x
>= 6.0, = 5.0, = 2.0, =1.0, = 1.0, = 0.10, Instructions for installing and deploying Elasticsearch can be found in
Elasticsearch installation page.

Enable ElasticSearch bundle in your AppKernel:

php
 ['all' => true],
];

(OPTIONAL) Step 2: Add configuration

Add minimal configuration for Elasticsearch bundle.

…

This is the very basic example only, for more information, please take a look at the configuration chapter.

Step 3: Define your Elasticsearch types as Document objects

This bundle uses objects to represent Elasticsearch documents. Lets create the Product class for the products index.

php
// src/Document/Product.php

namespace App\Document;

use ONGR\ElasticsearchBundle\Annotation as ES;

/**
 * //alias and default parameters in the annotation are optional. 
 * @ES\Index(alias="products", default=true)
 */
class Product
{
    /**
     * @ES\Id()
     */
    public $id;

    /**
     * @ES\Property(type="text", analyzer="eNgramAnalyzer")
     */
    public $title;

    /**
     * @ES\Property(type="float")
     */
    public $price;
}

This is the basic example only, for more information about a mapping, please take a look at the the mapping chapter.

Step 4: Create index and mappings

Elasticsearch bundle provides several CLI commands. One of them is for creating an index, run the command in your terminal:

bash

bin/console ongr:es:index:create

Now the products index should be created with fields from your document.

More info about the rest of the commands can be found in the commands chapter.

Step 5: Enjoy with the Elasticsearch

Full documentation for the Elasticsearch bundle is available here. I hope you will create amazing things with it :sunglasses: .

Please note that the updating process of the documentation of the bundle to 6.0 is still under way. Read the configuration and crud sections that are already updated and will allow you to have the basic functions of the bundle. We will update the rest of the documentation as soon as possible

Troubleshooting

  • How to upgrade from the older versions?
  • How to overwrite some parts of the bundle?

License

This bundle is licensed under the MIT license. Please, see the complete license in the bundle LICENSE file.

Issues· 58 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

PHPelasticsearchongrphpsymfony

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类数据库
定价开源

> 相关工具

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库