{"action":"created","issue":{"url":"https://api.github.com/repos/pat/thinking-sphinx/issues/999","repository_url":"https://api.github.com/repos/pat/thinking-sphinx","labels_url":"https://api.github.com/repos/pat/thinking-sphinx/issues/999/labels{/name}","comments_url":"https://api.github.com/repos/pat/thinking-sphinx/issues/999/comments","events_url":"https://api.github.com/repos/pat/thinking-sphinx/issues/999/events","html_url":"https://github.com/pat/thinking-sphinx/issues/999","id":169131458,"number":999,"title":"Getting 'Record IDs found by Sphinx but not by ActiveRecord'","user":{"login":"jonsgold","id":5622533,"avatar_url":"https://avatars.githubusercontent.com/u/5622533?v=3","gravatar_id":"","url":"https://api.github.com/users/jonsgold","html_url":"https://github.com/jonsgold","followers_url":"https://api.github.com/users/jonsgold/followers","following_url":"https://api.github.com/users/jonsgold/following{/other_user}","gists_url":"https://api.github.com/users/jonsgold/gists{/gist_id}","starred_url":"https://api.github.com/users/jonsgold/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonsgold/subscriptions","organizations_url":"https://api.github.com/users/jonsgold/orgs","repos_url":"https://api.github.com/users/jonsgold/repos","events_url":"https://api.github.com/users/jonsgold/events{/privacy}","received_events_url":"https://api.github.com/users/jonsgold/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/pat/thinking-sphinx/labels/discussion","name":"discussion","color":"bfdadc"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":14,"created_at":"2016-08-03T13:29:20Z","updated_at":"2016-08-09T12:25:47Z","closed_at":null,"body":"Hi Pat, I'm getting this error all the time: \r\n\r\n`ActionView::Template::Error (Record IDs found by Sphinx but not by ActiveRecord : long-list-of-ids )`\r\n\r\nI have a hunch that it is caused in part by the index of my comment model:\r\n\r\n```\r\nclass Comment < ActiveRecord::Base\r\n  belongs_to :commenter, polymorphic: true\r\n  belongs_to :user\r\n  ...\r\nend\r\n\r\nThinkingSphinx::Index.define :comment, with: :active_record, delta: ThinkingSphinx::Deltas::ResqueDelta do\r\n  where \"accounts.status='enabled'\"\r\n\r\n  indexes body\r\n\r\n  has id, as: :id_number\r\n  has updated_at\r\n  has commenter_id\r\n  has commenter_type\r\n  has user.id\r\n  has user.account_id, as: :account_id\r\n  has user.account.status, as: :account_status\r\nend\r\n```\r\n\r\nI noticed that searching might be returning comments from different accounts, not only the account of the user performing the search. I can't be certain, though, as I don't know to which objects `long-list-of-ids` refers in the error message.\r\n\r\nAm I right in my hunch? What can I do to fix this problem?\r\n\r\nThanks,\r\nJonathan"},"comment":{"url":"https://api.github.com/repos/pat/thinking-sphinx/issues/comments/238537095","html_url":"https://github.com/pat/thinking-sphinx/issues/999#issuecomment-238537095","issue_url":"https://api.github.com/repos/pat/thinking-sphinx/issues/999","id":238537095,"user":{"login":"pat","id":4183,"avatar_url":"https://avatars.githubusercontent.com/u/4183?v=3","gravatar_id":"","url":"https://api.github.com/users/pat","html_url":"https://github.com/pat","followers_url":"https://api.github.com/users/pat/followers","following_url":"https://api.github.com/users/pat/following{/other_user}","gists_url":"https://api.github.com/users/pat/gists{/gist_id}","starred_url":"https://api.github.com/users/pat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pat/subscriptions","organizations_url":"https://api.github.com/users/pat/orgs","repos_url":"https://api.github.com/users/pat/repos","events_url":"https://api.github.com/users/pat/events{/privacy}","received_events_url":"https://api.github.com/users/pat/received_events","type":"User","site_admin":false},"created_at":"2016-08-09T12:25:47Z","updated_at":"2016-08-09T12:25:47Z","body":"Hmm… not sure I have any inspiration on how this could work.\r\n\r\nBut, I'm still surprised this error came up - the initial Sphinx and SQL queries made by TS should be unfiltered (and thus, no error). Is CanCan or something else filtering out results under the hood in a monkey-patched approach?\r\n\r\nIf we can get past this error, then you could manually filter out search results that aren't allowed. Granted, that'd screw up any pagination on search results (though perhaps that's not important in this scenario?)."}}
{"actor":{"display_login":"pat"}}