{"action":"created","issue":{"url":"https://api.github.com/repos/algolia/algoliasearch-magento/issues/965","repository_url":"https://api.github.com/repos/algolia/algoliasearch-magento","labels_url":"https://api.github.com/repos/algolia/algoliasearch-magento/issues/965/labels{/name}","comments_url":"https://api.github.com/repos/algolia/algoliasearch-magento/issues/965/comments","events_url":"https://api.github.com/repos/algolia/algoliasearch-magento/issues/965/events","html_url":"https://github.com/algolia/algoliasearch-magento/issues/965","id":272859068,"number":965,"title":"Product search url adding indexer.php after enable the cron tab","user":{"login":"vijaymagento1","id":10975189,"avatar_url":"https://avatars0.githubusercontent.com/u/10975189?v=4","gravatar_id":"","url":"https://api.github.com/users/vijaymagento1","html_url":"https://github.com/vijaymagento1","followers_url":"https://api.github.com/users/vijaymagento1/followers","following_url":"https://api.github.com/users/vijaymagento1/following{/other_user}","gists_url":"https://api.github.com/users/vijaymagento1/gists{/gist_id}","starred_url":"https://api.github.com/users/vijaymagento1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vijaymagento1/subscriptions","organizations_url":"https://api.github.com/users/vijaymagento1/orgs","repos_url":"https://api.github.com/users/vijaymagento1/repos","events_url":"https://api.github.com/users/vijaymagento1/events{/privacy}","received_events_url":"https://api.github.com/users/vijaymagento1/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-11-10T08:41:42Z","updated_at":"2017-11-20T20:31:27Z","closed_at":"2017-11-20T11:40:18Z","author_association":"NONE","body":"Hi Algolia support team,\r\n\r\nWe have installed and configured **\"algolia search 1.12.0\"** module on the latest magento(1.9.3.6) and we have enabled Indexing Queue/cron and added queue cron tab **(*/5 * * * * php -f /absolute/path/to/magento/shell/indexer.php -- -reindex algolia_queue_runner)** on the server. After process indexing queue/cron, when we search the product on the frontend it's adding indexer.php on the product url. \r\n\r\nPlease review the issues ASAP and let us know solution, why Indexing Queue/cron adding indexer.php on the some of the product urls?\r\n\r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/algolia/algoliasearch-magento/issues/comments/345822171","html_url":"https://github.com/algolia/algoliasearch-magento/issues/965#issuecomment-345822171","issue_url":"https://api.github.com/repos/algolia/algoliasearch-magento/issues/965","id":345822171,"user":{"login":"hyteckit","id":4521604,"avatar_url":"https://avatars3.githubusercontent.com/u/4521604?v=4","gravatar_id":"","url":"https://api.github.com/users/hyteckit","html_url":"https://github.com/hyteckit","followers_url":"https://api.github.com/users/hyteckit/followers","following_url":"https://api.github.com/users/hyteckit/following{/other_user}","gists_url":"https://api.github.com/users/hyteckit/gists{/gist_id}","starred_url":"https://api.github.com/users/hyteckit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyteckit/subscriptions","organizations_url":"https://api.github.com/users/hyteckit/orgs","repos_url":"https://api.github.com/users/hyteckit/repos","events_url":"https://api.github.com/users/hyteckit/events{/privacy}","received_events_url":"https://api.github.com/users/hyteckit/received_events","type":"User","site_admin":false},"created_at":"2017-11-20T20:31:27Z","updated_at":"2017-11-20T20:31:27Z","author_association":"NONE","body":"JanPetr,\r\n\r\nYou are closing the case without fixing the BUG?\r\n\r\nWhat you've said it's not true. algoliasearch-magento does compose its own URL and stores the absolute path into the algolia database. It just does it incorrectly by relying on $product->getProductUrl() function.\r\n\r\nAnyway. Here's my fix. Under file \"Algolia>Algoliasearch>Helper>Entity>Producthelper.php\"\r\n\r\nChange getProductUrl() to getRequestPath(). That'll give you the relative path instead of the incorrect absolute path.\r\n\r\n```\r\n        $customData = array(\r\n            'objectID'           => $product->getId(),\r\n            'name'               => $product->getName(),\r\n            'url'                => $product->**getProductUrl**(),\r\n            'visibility_search'  => (int) (in_array($visibility, $visibleInSearch)),\r\n            'visibility_catalog' => (int) (in_array($visibility, $visibleInCatalog)),\r\n        );\r\n```\r\n\r\n```\r\n        $customData = array(\r\n            'objectID'           => $product->getId(),\r\n            'name'               => $product->getName(),\r\n            'url'                => $product->**getRequestPath**(),\r\n            'visibility_search'  => (int) (in_array($visibility, $visibleInSearch)),\r\n            'visibility_catalog' => (int) (in_array($visibility, $visibleInCatalog)),\r\n        );\r\n\r\n\r\n```"}}
{"actor":{"display_login":"hyteckit"}}