Skip to content

Commit

Permalink
Merge pull request #1846 from alongosz/ezp-26098-deprecate-se-specifi…
Browse files Browse the repository at this point in the history
…c-indexing-commands

EZP-26098: Deprecate SearchEngine-specific indexing commands
  • Loading branch information
andrerom committed Dec 1, 2016
2 parents 707c804 + c2d3131 commit 752eac8
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
Expand Up @@ -15,6 +15,9 @@
use eZ\Publish\SPI\Persistence\Content\ContentInfo;
use PDO;

/**
* @deprecated since 6.7, use ezplatform:reindex command instead.
*/
class ElasticsearchCreateIndexCommand extends ContainerAwareCommand
{
protected function configure()
Expand All @@ -32,6 +35,11 @@ protected function configure()

protected function execute(InputInterface $input, OutputInterface $output)
{
@trigger_error(
sprintf('%s is deprecated since 6.7. Use ezplatform:reindex command instead', $this->getName()),
E_USER_DEPRECATED
);

$bulkCount = $input->getArgument('bulk_count');

/** @var \eZ\Publish\SPI\Persistence\Handler $persistenceHandler */
Expand Down
Expand Up @@ -22,6 +22,8 @@
use PDO;

/**
* @deprecated since 6.7, use ezplatform:reindex command instead.
*
* Console command ezplatform:create_sql_search_index indexes content objects for legacy search
* engine.
*/
Expand Down Expand Up @@ -90,6 +92,11 @@ protected function configure()
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
@trigger_error(
sprintf('%s is deprecated since 6.7. Use ezplatform:reindex command instead', $this->getName()),
E_USER_DEPRECATED
);

$bulkCount = $input->getArgument('bulk_count');
// Indexing Content
$totalCount = $this->getContentObjectsTotalCount(
Expand Down
Expand Up @@ -190,15 +190,14 @@ private function cacheClear(OutputInterface $output)
*/
private function indexData(OutputInterface $output)
{
if ($this->searchEngine === 'solr') {
$output->writeln('Solr search engine configured, executing command ezplatform:solr_create_index');
$this->executeCommand($output, 'ezplatform:solr_create_index');
if (!in_array($this->searchEngine, ['solr', 'elasticsearch'])) {
return;
}

if ($this->searchEngine === 'elasticsearch') {
$output->writeln('Elasticsearch search engine configured, executing command ezplatform:elasticsearch_create_index');
$this->executeCommand($output, 'ezplatform:elasticsearch_create_index');
}
$output->writeln(
sprintf('%s search engine configured, executing command ezplatform:reindex', $this->searchEngine)
);
$this->executeCommand($output, 'ezplatform:reindex');
}

/**
Expand Down

0 comments on commit 752eac8

Please sign in to comment.