[SearchEngine] Update commands

This commit is contained in:
Romain Neutron
2012-08-24 11:44:10 +02:00
parent d120277cbf
commit bfed1a4d60
5 changed files with 33 additions and 3 deletions

View File

@@ -15,10 +15,12 @@
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
use Alchemy\Phrasea\Command\Command;
use Alchemy\Phrasea\SearchEngine\PhraseaEngineQueryParser;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Alchemy\Phrasea\Command\Command;
class module_console_checkExtension extends Command
{
@@ -147,7 +149,7 @@ class module_console_checkExtension extends Command
$tbases[$kbase]["searchcoll"] = $tcoll;
$tbases[$kbase]["mask_xor"] = $tbases[$kbase]["mask_and"] = 0;
$qp = new searchEngine_adapter_phrasea_queryParser($this->container);
$qp = new PhraseaEngineQueryParser();
$treeq = $qp->parsequery($input->getOption('query'));
$arrayq = $qp->makequery($treeq);

View File

@@ -201,6 +201,9 @@ class module_console_fieldsMerge extends Command
'value' => $data,
)), true);
}
$this->getService('phraseanet.SE')->updateRecord($record);
unset($record);
}

View File

@@ -38,6 +38,7 @@ class module_console_fileEnsureProductionSetting extends Command
, 'checkDatabaseScope'
, 'checkTeamplateEngineService'
, 'checkOrmService'
, 'checkSearchEngineService'
, 'checkCacheService'
, 'checkOpcodeCacheService'
, 'checkBorderService'
@@ -98,6 +99,9 @@ class module_console_fileEnsureProductionSetting extends Command
case 'checkOrmService' :
$display = "ORM";
break;
case 'checkSearchEngineService':
$display = 'Search Engine';
break;
case 'checkCacheService' :
$display = "Cache";
break;
@@ -510,6 +514,22 @@ class module_console_fileEnsureProductionSetting extends Command
return;
}
private function checkSearchEngineService(OutputInterface $output)
{
$SEName = $this->configuration->getSearchEngine();
$configuration = $this->configuration->getService($SEName);
try {
$service = Core\Service\Builder::create(\bootstrap::getCore(), $configuration);
$work_message = '<info>Works !</info>';
} catch (\Exception $e) {
$work_message = sprintf('<error>Failed : %s !</error>', $e->getMessage());
$this->errors ++;
}
$output->writeln(sprintf("\t--> Verify ORM engine <info>%s</info> : %s", $SEName, $work_message));
}
private function checkOrmService(OutputInterface $output)
{
$ormName = $this->configuration->getOrm();