|
| 1 | +# Console command to index entities |
| 2 | + |
| 3 | +**DoctrineSolrBundle** provides a console command for removing of entities. It can be useful if you need to remove a bunch entities of particular entity class. |
| 4 | +To run use the following command: |
| 5 | +``` |
| 6 | +app/console doctrine-solr:clear-index |
| 7 | +``` |
| 8 | + |
| 9 | +By default if no any arguments specified the command will remove all instances of entity classes specified in config.yml at "indexed_entities" section. |
| 10 | + |
| 11 | +You can specify which entity class exactly you want to be removed. For example if you have the following config: |
| 12 | +``` |
| 13 | +mdiyakov_doctrine_solr: |
| 14 | + indexed_entities: |
| 15 | + article: |
| 16 | + class: AppBundle\Entity\Page |
| 17 | + ... |
| 18 | + news: |
| 19 | + class: AppBundle\Entity\News |
| 20 | + ... |
| 21 | +``` |
| 22 | +You can run: |
| 23 | +``` |
| 24 | + app/console doctrine-solr:clear-index article |
| 25 | +``` |
| 26 | +or |
| 27 | +``` |
| 28 | + app/console doctrine-solr:clear-index news |
| 29 | +``` |
| 30 | +So in first case the all "AppBundle\Entity\Page" instances will be removed. In the second example all "AppBundle\Entity\News" instances will be removed |
| 31 | + |
| 32 | +Also you can take a look at "help" of this command to see all possible entity options. |
| 33 | + |
| 34 | +Beside this you can specify the "id" of particular enitity: |
| 35 | +``` |
| 36 | + app/console doctrine-solr:clear-index news 2 |
| 37 | +``` |
| 38 | + |
| 39 | + |
| 40 | +## Pages |
| 41 | +* [Getting started with DoctrineSolrBundle](getting_started.md) |
| 42 | +* [ Regular, fuzzy, wildcard, range and negative search](fuzzy_wildcard_range_negative_search.md) |
| 43 | +* [ Custom finder class ](custom_finder_class.md) |
| 44 | +* [ Filters ](filters.md) |
| 45 | +* [Schema search over multiple entities classes](schema_search.md) |
| 46 | +* [Suggestions](suggestions.md) |
| 47 | +* [Query building](query_building.md) |
| 48 | +* [Console command to index entities](Resources/doc/console.md) |
| 49 | +* [EntityManager. How to flush an entity safe ](Resources/doc/entity_manager.md) |
0 commit comments