{"action":"closed","issue":{"url":"https://api.github.com/repos/ankane/searchkick/issues/477","labels_url":"https://api.github.com/repos/ankane/searchkick/issues/477/labels{/name}","comments_url":"https://api.github.com/repos/ankane/searchkick/issues/477/comments","events_url":"https://api.github.com/repos/ankane/searchkick/issues/477/events","html_url":"https://github.com/ankane/searchkick/issues/477","id":96135727,"number":477,"title":"losing sync at least 3 times a week","user":{"login":"magicmarkker","id":33722,"avatar_url":"https://avatars.githubusercontent.com/u/33722?v=3","gravatar_id":"","url":"https://api.github.com/users/magicmarkker","html_url":"https://github.com/magicmarkker","followers_url":"https://api.github.com/users/magicmarkker/followers","following_url":"https://api.github.com/users/magicmarkker/following{/other_user}","gists_url":"https://api.github.com/users/magicmarkker/gists{/gist_id}","starred_url":"https://api.github.com/users/magicmarkker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magicmarkker/subscriptions","organizations_url":"https://api.github.com/users/magicmarkker/orgs","repos_url":"https://api.github.com/users/magicmarkker/repos","events_url":"https://api.github.com/users/magicmarkker/events{/privacy}","received_events_url":"https://api.github.com/users/magicmarkker/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-20T19:07:50Z","updated_at":"2015-07-21T13:07:41Z","closed_at":"2015-07-21T13:07:41Z","body":"Hi, I have a multi tenant app that uses searchkick for searching users, and at least three times a week it becomes out of sync and the search throws a `undefined method 'each' for nil:NilClass` If I run the same code in console, it returns properly.\r\n\r\n    def search\r\n      params[:page] ||= 1\r\n      params[:keyword] ||= \"*\"\r\n      @users = User.active\r\n      @users = @users.search(params[:keyword], operator: \"or\", fields: [{firstname: :word_start}, {lastname: :word_start}, {email: :word_start}, {companyname: :word_start}, {additional_text: :word_start}, {board_title: :word_start}, {userclass: :word_start}] ) rescue nil\r\n    end\r\nI followed the instructions on the setup page, and this is my user.rb file.\r\n\r\n    searchkick word_start: [:firstname, :lastname, :email, :companyemail, :companyname, :additional_text, :board_title, :userclass, :phone, :companyphone], settings: {number_of_shards: 1}\r\n\r\n      def search_data\r\n        as_json only: [:firstname, :lastname, :email, :companyemail, :companyname, :additional_text, :board_title, :userclass, :phone, :companyphone]\r\n      end"}}