{"action":"created","issue":{"url":"https://api.github.com/repos/algolia/algoliasearch-magento/issues/185","labels_url":"https://api.github.com/repos/algolia/algoliasearch-magento/issues/185/labels{/name}","comments_url":"https://api.github.com/repos/algolia/algoliasearch-magento/issues/185/comments","events_url":"https://api.github.com/repos/algolia/algoliasearch-magento/issues/185/events","html_url":"https://github.com/algolia/algoliasearch-magento/issues/185","id":103774785,"number":185,"title":"On install - disable everything until index is complete","user":{"login":"sam327","id":1746360,"avatar_url":"https://avatars.githubusercontent.com/u/1746360?v=3","gravatar_id":"","url":"https://api.github.com/users/sam327","html_url":"https://github.com/sam327","followers_url":"https://api.github.com/users/sam327/followers","following_url":"https://api.github.com/users/sam327/following{/other_user}","gists_url":"https://api.github.com/users/sam327/gists{/gist_id}","starred_url":"https://api.github.com/users/sam327/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sam327/subscriptions","organizations_url":"https://api.github.com/users/sam327/orgs","repos_url":"https://api.github.com/users/sam327/repos","events_url":"https://api.github.com/users/sam327/events{/privacy}","received_events_url":"https://api.github.com/users/sam327/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-08-28T18:46:17Z","updated_at":"2015-09-30T14:17:42Z","closed_at":null,"body":"Apologies if this is long...  \r\n\r\nWhen you install the algolia search and put in your various api keys, it instantly takes over the search results. The problem is that none of the indexes have been built yet. This means that for a little bit of time, we have blank search results. \r\n\r\nSo I suggest adding a toggle to turn off the search results - so while I'm getting the plugin started, my site continues to use the regular magento catalog search while I get algolia configured and the indexing done. \r\n\r\nThen I can switch on the components manually when the index is ready.\r\n\r\nMy preferred setup configuration would be something like: \r\n1. install plugin \r\n2. add license / api keys\r\n3. configure search options \r\n4. configure indexing\r\n5. run indexing (all at once or via cron)\r\n6. enable search results\r\n7. enable other features as desired\r\n\r\nDidn't really notice while doing development, as I'd installed, then spent a bunch of time doing design stuff... But when I rolled it up to the production environment, I had about 20 minutes of blank search results.\r\n"},"comment":{"url":"https://api.github.com/repos/algolia/algoliasearch-magento/issues/comments/144424932","html_url":"https://github.com/algolia/algoliasearch-magento/issues/185#issuecomment-144424932","issue_url":"https://api.github.com/repos/algolia/algoliasearch-magento/issues/185","id":144424932,"user":{"login":"Floddy","id":9537449,"avatar_url":"https://avatars.githubusercontent.com/u/9537449?v=3","gravatar_id":"","url":"https://api.github.com/users/Floddy","html_url":"https://github.com/Floddy","followers_url":"https://api.github.com/users/Floddy/followers","following_url":"https://api.github.com/users/Floddy/following{/other_user}","gists_url":"https://api.github.com/users/Floddy/gists{/gist_id}","starred_url":"https://api.github.com/users/Floddy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Floddy/subscriptions","organizations_url":"https://api.github.com/users/Floddy/orgs","repos_url":"https://api.github.com/users/Floddy/repos","events_url":"https://api.github.com/users/Floddy/events{/privacy}","received_events_url":"https://api.github.com/users/Floddy/received_events","type":"User","site_admin":false},"created_at":"2015-09-30T14:17:41Z","updated_at":"2015-09-30T14:17:41Z","body":"Dunno if you've found a way yet, but the solution I've seen the most is:\r\n1. config option, enble, yes/no\r\n2. a helper function that responds true/false if enable is yes, and api key isn't empty\r\n3. for every event observer, start with something like:\r\npublic funtion meepevent(Varien_Event_Observer $observer)\r\n{\r\nif(!$helper->isEnabled()) {\r\n    return;\r\n}\r\n4. for blocks, etc, an override of _toHtml:\r\nprotected function _toHtml()\r\n{\r\n    if(!$helper->isEnabled()) {\r\n        return '';\r\n    }\r\n    return parent::_toHtml;\r\n}\r\n5. for controllers, pretty much:\r\npublic function myAction()\r\n{\r\n    if(!$helper->isEnabled()) {\r\n        parent::myAction();\r\n        return;\r\n    }\r\n}\r\n\r\netc etc. :)"}}