{"action":"created","comment":{"url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/comments/90028159","pull_request_review_id":10553708,"id":90028159,"diff_hunk":"@@ -0,0 +1,73 @@\n+<?php\n+\n+/**\n+ * This file is part of the eZ Publish Kernel package.\n+ *\n+ * @copyright Copyright (C) eZ Systems AS. All rights reserved.\n+ * @license For full copyright and license information view LICENSE file distributed with this source code.\n+ */\n+namespace eZ\\Bundle\\EzPublishCoreBundle\\Command;\n+\n+use Symfony\\Bundle\\FrameworkBundle\\Command\\ContainerAwareCommand;\n+use Symfony\\Component\\Console\\Input\\InputInterface;\n+use Symfony\\Component\\Console\\Input\\InputOption;\n+use Symfony\\Component\\Console\\Output\\OutputInterface;\n+use eZ\\Publish\\Core\\Search\\Common\\Indexer;\n+use RuntimeException;\n+\n+class ReindexCommand extends ContainerAwareCommand\n+{\n+    /**\n+     * @var \\eZ\\Publish\\Core\\Search\\Common\\Indexer\n+     */\n+    private $searchIndexer;\n+\n+    /**\n+     * Initialize objects required by {@see execute()}.\n+     *\n+     * @param InputInterface $input\n+     * @param OutputInterface $output\n+     */\n+    public function initialize(InputInterface $input, OutputInterface $output)\n+    {\n+        parent::initialize($input, $output);\n+        $this->searchIndexer = $this->getContainer()->get('ezpublish.spi.search.indexer');\n+        if (!$this->searchIndexer instanceof Indexer) {\n+            throw new RuntimeException(\n+                sprintf('Expected to find Search Engine Indexer but found \"%s\" instead', get_parent_class($this->searchIndexer))\n+            );\n+        }\n+    }\n+\n+    /**\n+     * {@inheritdoc}\n+     */\n+    protected function configure()\n+    {\n+        $this\n+            ->setName('ezplatform:reindex')\n+            ->setDescription('Recreate search engine index')\n+            ->addOption('iteration-count', 'c', InputOption::VALUE_OPTIONAL, 'Number of objects to be indexed in a single iteration', 20)\n+            ->addOption('no-commit', null, InputOption::VALUE_NONE, 'Do not commit after each iteration')\n+            ->setHelp(\n+                <<<EOT\n+The command <info>%command.name%</info> indexes current configured database in configured search engine index.\n+EOT\n+            );\n+    }\n+\n+    /**\n+     * {@inheritdoc}\n+     */\n+    protected function execute(InputInterface $input, OutputInterface $output)\n+    {\n+        $iterationCount = $input->getOption('iteration-count');\n+        $noCommit = $input->getOption('no-commit');\n+\n+        if (!is_numeric($iterationCount) || (int)$iterationCount < 1) {\n+            throw new RuntimeException(\"'bulk_count' argument should be > 0, got '{$iterationCount}'\");","path":"eZ/Bundle/EzPublishCoreBundle/Command/ReindexCommand.php","position":null,"original_position":68,"commit_id":"2a52d0786962c49eff4056bfb46ff73d98096458","original_commit_id":"6c4a33161c2258c76b99587449ee3be21f7bdaf2","user":{"login":"alongosz","id":7099219,"avatar_url":"https://avatars.githubusercontent.com/u/7099219?v=3","gravatar_id":"","url":"https://api.github.com/users/alongosz","html_url":"https://github.com/alongosz","followers_url":"https://api.github.com/users/alongosz/followers","following_url":"https://api.github.com/users/alongosz/following{/other_user}","gists_url":"https://api.github.com/users/alongosz/gists{/gist_id}","starred_url":"https://api.github.com/users/alongosz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alongosz/subscriptions","organizations_url":"https://api.github.com/users/alongosz/orgs","repos_url":"https://api.github.com/users/alongosz/repos","events_url":"https://api.github.com/users/alongosz/events{/privacy}","received_events_url":"https://api.github.com/users/alongosz/received_events","type":"User","site_admin":false},"body":"Good catch, it's actually an option now, so I adjusted message in 2a52d07.","created_at":"2016-11-29T15:12:58Z","updated_at":"2016-11-29T15:12:58Z","html_url":"https://github.com/ezsystems/ezpublish-kernel/pull/1738#discussion_r90028159","pull_request_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/1738","_links":{"self":{"href":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/comments/90028159"},"html":{"href":"https://github.com/ezsystems/ezpublish-kernel/pull/1738#discussion_r90028159"},"pull_request":{"href":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/1738"}}},"pull_request":{"url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/1738","id":78360696,"html_url":"https://github.com/ezsystems/ezpublish-kernel/pull/1738","diff_url":"https://github.com/ezsystems/ezpublish-kernel/pull/1738.diff","patch_url":"https://github.com/ezsystems/ezpublish-kernel/pull/1738.patch","issue_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/1738","number":1738,"state":"open","locked":false,"title":"EZP-26098: Add generic command to recreate search engine index","user":{"login":"alongosz","id":7099219,"avatar_url":"https://avatars.githubusercontent.com/u/7099219?v=3","gravatar_id":"","url":"https://api.github.com/users/alongosz","html_url":"https://github.com/alongosz","followers_url":"https://api.github.com/users/alongosz/followers","following_url":"https://api.github.com/users/alongosz/following{/other_user}","gists_url":"https://api.github.com/users/alongosz/gists{/gist_id}","starred_url":"https://api.github.com/users/alongosz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alongosz/subscriptions","organizations_url":"https://api.github.com/users/alongosz/orgs","repos_url":"https://api.github.com/users/alongosz/repos","events_url":"https://api.github.com/users/alongosz/events{/privacy}","received_events_url":"https://api.github.com/users/alongosz/received_events","type":"User","site_admin":false},"body":"> Status: **Ready for a review**.\r\n> Implements: [EZP-26098](https://jira.ez.no/browse/EZP-26098).\r\n\r\nThis PR adds generic `ezplatform:reindex` command able to recreate Search Engine Index for any Search Engine extending Search Engine Indexer Service.\r\nThe Service should be tagged as `ezpublish.searchEngineIndexer` with an alias corresponding to a specific search engine (legacy, solr, elasticsearch).\r\n\r\n**TODO**:\r\n- [x] Add abstract Indexer Service, to be extended by each Search Engine  (af09e66).\r\n- [x] Add `ezplatform:reindex` command to `EzPublishCoreBundle` (2ef2440).\r\n- [x] Add Indexer Service for Legacy Search Engine (d4ff5c4).\r\n- [x] Add Indexer Service for Elasticsearch Search Engine (b3b31f0).\r\n- [x] Fix Elasticsearch Handler service definition (6c4a331).\r\n- [x] Add Indexer Service for Solr ([Solr PR #68](https://github.com/ezsystems/ezplatform-solr-search-engine/pull/68)).\r\n\r\n_Note: This PR was rebased, removing any code related to previous approach. Old code is available [here](https://github.com/ezsystems/ezpublish-kernel/compare/master...alongosz:ezp-26098-backup-20160926)._\r\n","created_at":"2016-07-21T18:03:57Z","updated_at":"2016-11-29T15:12:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0fa189278921ebd4418d5d2bcfafa88e9bfcb8cf","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/1738/commits","review_comments_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/1738/comments","review_comment_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/1738/comments","statuses_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/statuses/2a52d0786962c49eff4056bfb46ff73d98096458","head":{"label":"alongosz:ezp-26098-generic-search-engine-indexing-command","ref":"ezp-26098-generic-search-engine-indexing-command","sha":"2a52d0786962c49eff4056bfb46ff73d98096458","user":{"login":"alongosz","id":7099219,"avatar_url":"https://avatars.githubusercontent.com/u/7099219?v=3","gravatar_id":"","url":"https://api.github.com/users/alongosz","html_url":"https://github.com/alongosz","followers_url":"https://api.github.com/users/alongosz/followers","following_url":"https://api.github.com/users/alongosz/following{/other_user}","gists_url":"https://api.github.com/users/alongosz/gists{/gist_id}","starred_url":"https://api.github.com/users/alongosz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alongosz/subscriptions","organizations_url":"https://api.github.com/users/alongosz/orgs","repos_url":"https://api.github.com/users/alongosz/repos","events_url":"https://api.github.com/users/alongosz/events{/privacy}","received_events_url":"https://api.github.com/users/alongosz/received_events","type":"User","site_admin":false},"repo":{"id":58625909,"name":"ezpublish-kernel","full_name":"alongosz/ezpublish-kernel","owner":{"login":"alongosz","id":7099219,"avatar_url":"https://avatars.githubusercontent.com/u/7099219?v=3","gravatar_id":"","url":"https://api.github.com/users/alongosz","html_url":"https://github.com/alongosz","followers_url":"https://api.github.com/users/alongosz/followers","following_url":"https://api.github.com/users/alongosz/following{/other_user}","gists_url":"https://api.github.com/users/alongosz/gists{/gist_id}","starred_url":"https://api.github.com/users/alongosz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alongosz/subscriptions","organizations_url":"https://api.github.com/users/alongosz/orgs","repos_url":"https://api.github.com/users/alongosz/repos","events_url":"https://api.github.com/users/alongosz/events{/privacy}","received_events_url":"https://api.github.com/users/alongosz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alongosz/ezpublish-kernel","description":"eZ Platform (aka eZ Publish 6.x) kernel","fork":true,"url":"https://api.github.com/repos/alongosz/ezpublish-kernel","forks_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/forks","keys_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/teams","hooks_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/hooks","issue_events_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/issues/events{/number}","events_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/events","assignees_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/assignees{/user}","branches_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/branches{/branch}","tags_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/tags","blobs_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/git/refs{/sha}","trees_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/statuses/{sha}","languages_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/languages","stargazers_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/stargazers","contributors_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/contributors","subscribers_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/subscribers","subscription_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/subscription","commits_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/commits{/sha}","git_commits_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/git/commits{/sha}","comments_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/comments{/number}","issue_comment_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/issues/comments{/number}","contents_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/contents/{+path}","compare_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/merges","archive_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/downloads","issues_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/issues{/number}","pulls_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/pulls{/number}","milestones_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/milestones{/number}","notifications_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/labels{/name}","releases_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/releases{/id}","deployments_url":"https://api.github.com/repos/alongosz/ezpublish-kernel/deployments","created_at":"2016-05-12T09:06:18Z","updated_at":"2016-05-12T09:06:28Z","pushed_at":"2016-11-29T15:08:24Z","git_url":"git://github.com/alongosz/ezpublish-kernel.git","ssh_url":"git@github.com:alongosz/ezpublish-kernel.git","clone_url":"https://github.com/alongosz/ezpublish-kernel.git","svn_url":"https://github.com/alongosz/ezpublish-kernel","homepage":"http://ezplatform.com/","size":47214,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"ezsystems:master","ref":"master","sha":"5d5ac8aaf0b263b37171117d20013e0aba292513","user":{"login":"ezsystems","id":295311,"avatar_url":"https://avatars.githubusercontent.com/u/295311?v=3","gravatar_id":"","url":"https://api.github.com/users/ezsystems","html_url":"https://github.com/ezsystems","followers_url":"https://api.github.com/users/ezsystems/followers","following_url":"https://api.github.com/users/ezsystems/following{/other_user}","gists_url":"https://api.github.com/users/ezsystems/gists{/gist_id}","starred_url":"https://api.github.com/users/ezsystems/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ezsystems/subscriptions","organizations_url":"https://api.github.com/users/ezsystems/orgs","repos_url":"https://api.github.com/users/ezsystems/repos","events_url":"https://api.github.com/users/ezsystems/events{/privacy}","received_events_url":"https://api.github.com/users/ezsystems/received_events","type":"Organization","site_admin":false},"repo":{"id":1663890,"name":"ezpublish-kernel","full_name":"ezsystems/ezpublish-kernel","owner":{"login":"ezsystems","id":295311,"avatar_url":"https://avatars.githubusercontent.com/u/295311?v=3","gravatar_id":"","url":"https://api.github.com/users/ezsystems","html_url":"https://github.com/ezsystems","followers_url":"https://api.github.com/users/ezsystems/followers","following_url":"https://api.github.com/users/ezsystems/following{/other_user}","gists_url":"https://api.github.com/users/ezsystems/gists{/gist_id}","starred_url":"https://api.github.com/users/ezsystems/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ezsystems/subscriptions","organizations_url":"https://api.github.com/users/ezsystems/orgs","repos_url":"https://api.github.com/users/ezsystems/repos","events_url":"https://api.github.com/users/ezsystems/events{/privacy}","received_events_url":"https://api.github.com/users/ezsystems/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ezsystems/ezpublish-kernel","description":"Kernel (Repository, MVC layer, REST) for eZ Platform","fork":false,"url":"https://api.github.com/repos/ezsystems/ezpublish-kernel","forks_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/forks","keys_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/teams","hooks_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/hooks","issue_events_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/events{/number}","events_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/events","assignees_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/assignees{/user}","branches_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/branches{/branch}","tags_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/tags","blobs_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/git/refs{/sha}","trees_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/statuses/{sha}","languages_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/languages","stargazers_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/stargazers","contributors_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/contributors","subscribers_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/subscribers","subscription_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/subscription","commits_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/commits{/sha}","git_commits_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/git/commits{/sha}","comments_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/comments{/number}","issue_comment_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/comments{/number}","contents_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/contents/{+path}","compare_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/merges","archive_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/downloads","issues_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues{/number}","pulls_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls{/number}","milestones_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/milestones{/number}","notifications_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/labels{/name}","releases_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/releases{/id}","deployments_url":"https://api.github.com/repos/ezsystems/ezpublish-kernel/deployments","created_at":"2011-04-26T08:54:24Z","updated_at":"2016-11-26T05:04:58Z","pushed_at":"2016-11-29T15:08:25Z","git_url":"git://github.com/ezsystems/ezpublish-kernel.git","ssh_url":"git@github.com:ezsystems/ezpublish-kernel.git","clone_url":"https://github.com/ezsystems/ezpublish-kernel.git","svn_url":"https://github.com/ezsystems/ezpublish-kernel","homepage":"http://ezplatform.com/","size":53081,"stargazers_count":118,"watchers_count":118,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":164,"mirror_url":null,"open_issues_count":62,"forks":164,"open_issues":62,"watchers":118,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/1738"},"html":{"href":"https://github.com/ezsystems/ezpublish-kernel/pull/1738"},"issue":{"href":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/1738"},"comments":{"href":"https://api.github.com/repos/ezsystems/ezpublish-kernel/issues/1738/comments"},"review_comments":{"href":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/1738/comments"},"review_comment":{"href":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ezsystems/ezpublish-kernel/pulls/1738/commits"},"statuses":{"href":"https://api.github.com/repos/ezsystems/ezpublish-kernel/statuses/2a52d0786962c49eff4056bfb46ff73d98096458"}}}}
{"actor":{"display_login":"alongosz"}}