Changeset 1336


Ignore:
Timestamp:
Sep 9, 2010, 10:54:33 AM (10 years ago)
Author:
teymour
Message:

Ajout d'un option qui permet de supprimer la base Solr

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpc/trunk/project/lib/task/indexSolrTask.class.php

    r1320 r1336  
    1919    $this->addOption('env', null, sfCommandOption::PARAMETER_OPTIONAL, 'Changes the environment this task is run in', 'test');
    2020    $this->addOption('app', null, sfCommandOption::PARAMETER_OPTIONAL, 'Changes the environment this task is run in', 'frontend');
     21    $this->addOption('removeAll', null, sfCommandOption::PARAMETER_OPTIONAL, 'Drop solr database (=no|yes no default)', 'no');
    2122
    2223    $this->file_conf = sys_get_temp_dir().DIRECTORY_SEPARATOR."reindex_slor.db";
     
    3334
    3435    $solr = new SolrConnector();
     36
     37    if ($options['removeAll'] == 'yes') {
     38      $solr->deleteAll();
     39    }
    3540
    3641    foreach(array("Parlementaire", "Commentaire", "QuestionEcrite", "Amendement", "Intervention") as $table) {
Note: See TracChangeset for help on using the changeset viewer.