{"id":14983719,"url":"https://github.com/ongr-io/elasticsearchbundle","last_synced_at":"2025-05-15T11:06:32.194Z","repository":{"id":22580897,"uuid":"25922479","full_name":"ongr-io/ElasticsearchBundle","owner":"ongr-io","description":"Symfony bundle for Elasticsearch with steroids","archived":false,"fork":false,"pushed_at":"2023-03-20T13:34:43.000Z","size":2603,"stargazers_count":312,"open_issues_count":59,"forks_count":188,"subscribers_count":29,"default_branch":"master","last_synced_at":"2025-05-15T09:07:19.557Z","etag":null,"topics":["elasticsearch","ongr","php","symfony","symfony-bundle","symfony3"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ongr-io.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2014-10-29T13:37:30.000Z","updated_at":"2025-03-04T14:17:42.000Z","dependencies_parsed_at":"2023-09-27T03:36:52.705Z","dependency_job_id":null,"html_url":"https://github.com/ongr-io/ElasticsearchBundle","commit_stats":{"total_commits":1080,"total_committers":92,"mean_commits":11.73913043478261,"dds":0.7203703703703703,"last_synced_commit":"effce6a1d38415e4dc72aedc9351a885bfabefdd"},"previous_names":[],"tags_count":91,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ongr-io%2FElasticsearchBundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ongr-io%2FElasticsearchBundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ongr-io%2FElasticsearchBundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ongr-io%2FElasticsearchBundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ongr-io","download_url":"https://codeload.github.com/ongr-io/ElasticsearchBundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254328385,"owners_count":22052632,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elasticsearch","ongr","php","symfony","symfony-bundle","symfony3"],"created_at":"2024-09-24T14:07:49.571Z","updated_at":"2025-05-15T11:06:32.177Z","avatar_url":"https://github.com/ongr-io.png","language":"PHP","funding_links":["https://www.buymeacoffee.com/zIKBXRc"],"categories":[],"sub_categories":[],"readme":"# ONGR Elasticsearch Bundle\n\n[![Build Status](https://travis-ci.org/ongr-io/ElasticsearchBundle.svg?branch=master)](https://travis-ci.org/ongr-io/ElasticsearchBundle)\n[![Latest Stable Version](https://poser.pugx.org/ongr/elasticsearch-bundle/v/stable)](https://packagist.org/packages/ongr/elasticsearch-bundle)\n[![codecov](https://codecov.io/gh/ongr-io/ElasticsearchBundle/branch/master/graph/badge.svg)](https://codecov.io/gh/ongr-io/ElasticsearchBundle)\n[![Total Downloads](https://poser.pugx.org/ongr/elasticsearch-bundle/downloads)](https://packagist.org/packages/ongr/elasticsearch-bundle)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/ongr-io/ElasticsearchBundle/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/ongr-io/ElasticsearchBundle/?branch=master)\n\n\nElasticsearch Bundle was created in order to serve the need for\nprofessional [Elasticsearch][1] integration with enterprise level Symfony\napplications. This bundle is:\n\n* Uses the official [elasticsearch-php][2] client.\n* Ensures full integration with Symfony framework and Symfony Flex.\n\nTechnical goodies:\n\n* Provides a DSL query builder which represent all ElasticSearch endpoints in the objective way.\n* Provides interactive Document object generator via CLI command (`ongr:es:document:generate`)\n* Creates a familiar Doctrine-like way to work with documents(entities) document-object mapping using annotations.\n* Several query results iterators are provided for your convenience to work with results.\n* Console CLI commands for the index management and data import/export/reindex.\n* Profiler that integrates in the Symfony debug bar and shows all executed queries.\n* Designed in an extensible way for all your custom needs.\n* Supports Symfony FLEX.\n\nIf you need any help, [stack overflow][3] is the preferred way to get answers.\nis the preferred and recommended way to ask questions about ONGR bundles and libraries.\n\nIf you like this library, help me to develop it by buying a cup of coffee\n\n\u003ca href=\"https://www.buymeacoffee.com/zIKBXRc\" target=\"_blank\"\u003e\u003cimg src=\"https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png\" alt=\"Buy Me A Coffee\" style=\"height: 41px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;\" \u003e\u003c/a\u003e\n\n\n## Version matrix\n\n| Elasticsearch version | ElasticsearchBundle version      |\n| --------------------- | -------------------------------- |\n| \u003e= 7.0                | ~7.x                             |\n| \u003e= 6.0, \u003c 7.0         | ~6.x                             |\n| \u003e= 5.0, \u003c 5.0         | ~5.x, ~6.x (indexes with 1 type) |\n| \u003e= 2.0, \u003c 5.0         | \u003e=1.0, \u003c 5.0                     |\n| \u003e= 1.0, \u003c 2.0         | \u003e= 0.10, \u003c 1.0                   |\n| \u003c= 0.90.x             | \u003c 0.10                           |\n\n## Documentation\n\nThe online documentation of the bundle can be found in [http://docs.ongr.io][4].\nDocs source is stored within the repo under `Resources/doc/`, so if you see a typo or some inaccuracy, please submit a PR or at least an issue to fix it!\n\n*For contribution to the documentation you can find it in the [contribute][5] topic.*\n\n## FAQ\n* [Index mapping][6]\n* [Configuration][7]\n* [Console commands][8]\n* [How to do simple CRUD actions][9]\n* [Quick find functions][10]\n* [How to execute search in the index][11]\n* [Parsing the results][12]\n\n## Setup the bundle\n\n#### Step 1: Install Elasticsearch bundle\n\nElasticsearch bundle is installed using [Composer][13].\n\n```bash\nphp composer.phar require ongr/elasticsearch-bundle \"~6.0\"\n```\n\n\u003e Instructions for installing and deploying Elasticsearch can be found in\n [Elasticsearch installation page][14].\n\nEnable ElasticSearch bundle in your AppKernel:\n\n```php\n\u003c?php\n// config/bundles.php\n\nreturn [\n    // ...\n    ONGR\\ElasticsearchBundle\\ONGRElasticsearchBundle::class =\u003e ['all' =\u003e true],\n];\n\n```\n\n#### (OPTIONAL) Step 2: Add configuration \n\nAdd minimal configuration for Elasticsearch bundle.\n\n```yaml\n\n# config/packages/ongr_elasticsearch.yaml\nongr_elasticsearch:\n    analysis:\n        filter:\n            edge_ngram_filter: #-\u003e your custom filter name to use in the analyzer below\n                type: edge_ngram \n                min_gram: 1\n                max_gram: 20\n        analyzer:\n            eNgramAnalyzer: #-\u003e analyzer name to use in the document field\n                type: custom\n                tokenizer: standard\n                filter:\n                    - lowercase\n                    - edge_ngram_filter #that's the filter defined earlier\n    indexes:\n        App\\Document\\Product:\n            hosts: [elasticsearch:9200] # optional, the default is 127.0.0.1:9200\n\n```\n\n\u003e This is the very basic example only, for more information, please take a look at the [configuration][9] chapter.\n\n#### Step 3: Define your Elasticsearch types as `Document` objects\n\nThis bundle uses objects to represent Elasticsearch documents. Lets create the `Product` class for the `products` index.\n\n```php\n// src/Document/Product.php\n\nnamespace App\\Document;\n\nuse ONGR\\ElasticsearchBundle\\Annotation as ES;\n\n/**\n * //alias and default parameters in the annotation are optional. \n * @ES\\Index(alias=\"products\", default=true)\n */\nclass Product\n{\n    /**\n     * @ES\\Id()\n     */\n    public $id;\n\n    /**\n     * @ES\\Property(type=\"text\", analyzer=\"eNgramAnalyzer\")\n     */\n    public $title;\n\n    /**\n     * @ES\\Property(type=\"float\")\n     */\n    public $price;\n}\n\n```\n\n\u003e This is the basic example only, for more information about a mapping, please take a look\n at the [the mapping chapter][6].\n\n\n#### Step 4: Create index and mappings\n\nElasticsearch bundle provides several `CLI` commands. One of them is for creating an index, run the command in your terminal:\n\n```bash\n\nbin/console ongr:es:index:create\n\n```\nNow the `products` index should be created with fields from your document.  \n\n\u003e More info about the rest of the commands can be found in the [commands chapter][8].\n\n\n#### Step 5: Enjoy with the Elasticsearch\n\nFull documentation for the Elasticsearch bundle is [available here][4].\nI hope you will create amazing things with it :sunglasses: .\n\n\u003e Please note that the updating process of the documentation of the bundle to 6.0\n\u003eis still under way. Read the [configuration][7] and [crud][9] sections that are \n\u003ealready updated and will allow you to have the basic functions of the bundle. We\n\u003ewill update the rest of the documentation as soon as possible\n\n## Troubleshooting\n* [How to upgrade from the older versions?][15]\n* [How to overwrite some parts of the bundle?][16]\n\n## License\n\nThis bundle is licensed under the [MIT license](LICENSE). Please, see the complete license\nin the bundle `LICENSE` file.\n\n[1]: https://www.elastic.co/products/elasticsearch\n[2]: https://github.com/elastic/elasticsearch-php\n[3]: http://stackoverflow.com/questions/tagged/ongr\n[4]: http://docs.ongr.io/ElasticsearchBundle\n[5]: http://docs.ongr.io/common/Contributing\n[6]: http://docs.ongr.io/ElasticsearchBundle/mapping\n[7]: http://docs.ongr.io/ElasticsearchBundle/configuration\n[8]: http://docs.ongr.io/ElasticsearchBundle/commands\n[9]: http://docs.ongr.io/ElasticsearchBundle/crud\n[10]: http://docs.ongr.io/ElasticsearchBundle/find_functions\n[11]: http://docs.ongr.io/ElasticsearchBundle/search\n[12]: http://docs.ongr.io/ElasticsearchBundle/results_parsing\n[13]: https://getcomposer.org\n[14]: https://www.elastic.co/downloads/elasticsearch\n[15]: http://docs.ongr.io/ElasticsearchBundle/upgrade\n[16]: http://docs.ongr.io/ElasticsearchBundle/overwriting_bundle\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fongr-io%2Felasticsearchbundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fongr-io%2Felasticsearchbundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fongr-io%2Felasticsearchbundle/lists"}