{"id":14983624,"url":"https://github.com/mdiyakov/doctrinesolrbundle","last_synced_at":"2025-04-10T19:02:41.386Z","repository":{"id":62526265,"uuid":"122770920","full_name":"mdiyakov/DoctrineSolrBundle","owner":"mdiyakov","description":"Symfony 2/3 bundle for integration Doctrine entities with Solr","archived":false,"fork":false,"pushed_at":"2018-07-01T15:19:22.000Z","size":140,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-03T06:41:42.448Z","etag":null,"topics":["bundle","doctrine","fulltext-search","php","search","solr","symfony","symfony-bundle","symfony2","symfony3"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mdiyakov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-24T19:09:16.000Z","updated_at":"2020-06-22T07:10:58.000Z","dependencies_parsed_at":"2022-11-02T11:01:45.940Z","dependency_job_id":null,"html_url":"https://github.com/mdiyakov/DoctrineSolrBundle","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdiyakov%2FDoctrineSolrBundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdiyakov%2FDoctrineSolrBundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdiyakov%2FDoctrineSolrBundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdiyakov%2FDoctrineSolrBundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mdiyakov","download_url":"https://codeload.github.com/mdiyakov/DoctrineSolrBundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239362408,"owners_count":19626124,"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":["bundle","doctrine","fulltext-search","php","search","solr","symfony","symfony-bundle","symfony2","symfony3"],"created_at":"2024-09-24T14:07:41.806Z","updated_at":"2025-02-17T20:32:24.238Z","avatar_url":"https://github.com/mdiyakov.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DoctrineSolrBundle\n[![SensioLabsInsight](https://insight.sensiolabs.com/projects/18962102-252f-4e26-a990-37072d3061b7/small.png)](https://insight.sensiolabs.com/projects/18962102-252f-4e26-a990-37072d3061b7)\n[![Build Status](https://travis-ci.org/mdiyakov/DoctrineSolrBundle.svg?branch=master)](https://travis-ci.org/mdiyakov/DoctrineSolrBundle)\n[![Latest Stable Version](https://poser.pugx.org/mdiyakov/doctrine-solr-bundle/v/stable)](https://packagist.org/packages/mdiyakov/doctrine-solr-bundle)\n[![License](https://poser.pugx.org/mdiyakov/doctrine-solr-bundle/license)](https://packagist.org/packages/mdiyakov/doctrine-solr-bundle)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/mdiyakov/DoctrineSolrBundle/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/mdiyakov/DoctrineSolrBundle/?branch=master)\n\nDoctrineSolrBundle is a Symfony bundle designed to mitigate Solr usage in symfony projects\n\n\n# Features\n* Auto-indexing doctrine entities in Solr\n* Supports wildcard, fuzzy \u0026 negative searches by specific entity fields\n* Supports Range searches by specific entity fields\n* Supports Boosting a Term by specific entity fields\n* Supports Solr SuggestComponent \n* Supports filters by entity fields or custom symfony service before indexing \n* Auto-resolving search results in Doctrine entities\n* Supports implementation of separate finder class for particular entity class  \n* Flexible query building interface\n* Cross-search over different entity classes\n\n\n# Installation\n\n### Step 1 Download DoctrineSolrBundle using composer\n\n```\n$ composer require mdiyakov/doctrine-solr-bundle\n```\nComposer will install the bundle to your project's vendor/mdiyakov/doctrine-solr-bundle directory.\n\n\n### Step 2\n\nEnable the bundle in the kernel :\n```\n// app/AppKernel.php\n\npublic function registerBundles()\n{\n\t$bundles = array(\n\t\t// ...\n\t\tnew Nelmio\\SolariumBundle\\NelmioSolariumBundle(),\n\t\tnew Mdiyakov\\DoctrineSolrBundle\\MdiyakovDoctrineSolrBundle(),\n\t\t// ...\n\t);\n}\n```\n\u003e You have to install \"NelmioSolariumBundle\" also because it's used by MdiyakovDoctrineSolrBundle\n\n### Step 3 : Quick start with DoctrineSolrBundle\n\n#### Prerequisites\n* Solr schema.yml created and solr core is initialized\n* Solr schema.yml unique field is \"uid\"\n* Solr schema.yml consists \"document_id\", \"document_title\" and \"discriminator\" fields\n* AppBundle\\Entity\\MyEntity is created and has \"id\" and \"title\" fields\n\nDoctrineSolrBundle is using [\"NelmioSolariumBundle\"](https://github.com/nelmio/NelmioSolariumBundle) for solarium integration. So you need to set a configuration to use it. Here is minimum config:\n```yml\nnelmio_solarium: ~\n```\nThe default solr endpoint will be used in this case (http://localhost:8983/solr)\n\nInit bundle configuration in config.yml. Quick example:\n\n```yml\n mdiyakov_doctrine_solr:\n    indexed_entities:\n        my_entity:\n            class: AppBundle\\Entity\\MyEntity\n            schema: my_schema\n            config:\n                - { name: config_field_name, value: config_field_value }\n    schemes:\n        my_schema:\n            document_unique_field: { name: 'uid' }\n            config_entity_fields:\n                - {  config_field_name: 'config_field_name', document_field_name: 'discriminator', discriminator: true }\n            fields:\n                - {  entity_field_name: 'id', document_field_name: 'document_id', field_type: int, entity_primary_key: true }\n                - {  entity_field_name: 'title', document_field_name: 'document_title', suggester: 'title' }\n```\n\nAs a result \"id\" and \"title\" fields of \"AppBundle\\Entity\\MyEntity\" will be synced with Solr \neach time \"AppBundle\\Entity\\MyEntity\" is created, updated or removed.      \n \n\u003eIf you use doctrine/orm \u003c 2.5 then you have to add an annotation to \"AppBundle\\Entity\\MyEntity\" class:\n```\n@ORM\\EntityListeners({\"Mdiyakov\\DoctrineSolrBundle\\EventListener\\DoctrineEntityListener\"})\n```\n\n\n**To search \"AppBundle\\Entity\\MyEntity\" use the following code:**\n\n```php\n// MyController\n//...\n// @var \\Mdiyakov\\DoctrineSolrBundle\\Finder\\ClassFinder $finder \n$finder = $this-\u003eget('ds.finder')-\u003egetClassFinder(MyEntity::class);\n\n/** @var MyEntity[] $searchResults */\n$searchResults = $finder-\u003efindSearchTermByFields($searchTerm, ['title']);\n//...\n```\n\n\n## Next steps\n1. [Getting started with DoctrineSolrBundle](Resources/doc/getting_started.md)\n2. [ Regular, fuzzy, wildcard, range and negative search](Resources/doc/fuzzy_wildcard_range_negative_search.md) \n3. [ Custom finder class ](Resources/doc/custom_finder_class.md)\n4. [ Filters ](Resources/doc/filters.md)\n5. [Schema search across multiple entities classes](Resources/doc/schema_search.md)\n6. [Suggestions](Resources/doc/suggestions.md)\n7. [Query building](Resources/doc/query_building.md)\n8. [Console command to index entities](Resources/doc/console.md)\n9. [Console command to delete entities ](Resources/doc/console_delete.md)\n10. [EntityManager. How to flush an entity safe ](Resources/doc/entity_manager.md)\n11. [Roadmap](https://github.com/mdiyakov/DoctrineSolrBundle/wiki/Roadmap-for-April,-2018)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdiyakov%2Fdoctrinesolrbundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmdiyakov%2Fdoctrinesolrbundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdiyakov%2Fdoctrinesolrbundle/lists"}