{"action":"created","issue":{"url":"https://api.github.com/repos/hydroshare/hydroshare/issues/1164","repository_url":"https://api.github.com/repos/hydroshare/hydroshare","labels_url":"https://api.github.com/repos/hydroshare/hydroshare/issues/1164/labels{/name}","comments_url":"https://api.github.com/repos/hydroshare/hydroshare/issues/1164/comments","events_url":"https://api.github.com/repos/hydroshare/hydroshare/issues/1164/events","html_url":"https://github.com/hydroshare/hydroshare/issues/1164","id":151154659,"number":1164,"title":"Changes necessary for SOLR realtime updates ","user":{"login":"alvacouch","id":3342292,"avatar_url":"https://avatars.githubusercontent.com/u/3342292?v=3","gravatar_id":"","url":"https://api.github.com/users/alvacouch","html_url":"https://github.com/alvacouch","followers_url":"https://api.github.com/users/alvacouch/followers","following_url":"https://api.github.com/users/alvacouch/following{/other_user}","gists_url":"https://api.github.com/users/alvacouch/gists{/gist_id}","starred_url":"https://api.github.com/users/alvacouch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alvacouch/subscriptions","organizations_url":"https://api.github.com/users/alvacouch/orgs","repos_url":"https://api.github.com/users/alvacouch/repos","events_url":"https://api.github.com/users/alvacouch/events{/privacy}","received_events_url":"https://api.github.com/users/alvacouch/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/hydroshare/hydroshare/labels/Discovery","name":"Discovery","color":"fad8c7"},{"url":"https://api.github.com/repos/hydroshare/hydroshare/labels/in%20progress","name":"in progress","color":"ededed"}],"state":"open","locked":false,"assignee":{"login":"xuezhaokun","id":6678333,"avatar_url":"https://avatars.githubusercontent.com/u/6678333?v=3","gravatar_id":"","url":"https://api.github.com/users/xuezhaokun","html_url":"https://github.com/xuezhaokun","followers_url":"https://api.github.com/users/xuezhaokun/followers","following_url":"https://api.github.com/users/xuezhaokun/following{/other_user}","gists_url":"https://api.github.com/users/xuezhaokun/gists{/gist_id}","starred_url":"https://api.github.com/users/xuezhaokun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xuezhaokun/subscriptions","organizations_url":"https://api.github.com/users/xuezhaokun/orgs","repos_url":"https://api.github.com/users/xuezhaokun/repos","events_url":"https://api.github.com/users/xuezhaokun/events{/privacy}","received_events_url":"https://api.github.com/users/xuezhaokun/received_events","type":"User","site_admin":false},"milestone":null,"comments":35,"created_at":"2016-04-26T14:46:13Z","updated_at":"2016-05-02T12:27:24Z","closed_at":null,"body":"@xuezhaokun @dtarb @rayi113 @hyi @pkdash \r\n\r\nTurning on real-time updates in SOLR doesn't work at all. Neither do any of the patterns for queueing updates. Changes need to be made so that this will work properly. \r\n\r\nHere is the crux of the problem as I see it now: \r\n\r\nBy default, RealtimeSignalProcessor.setup only schedules responders for the subclasses of SearchIndex that you register in haystack. Since we only have a subclass for BaseResource, this means – in particular – that it only registers responders for BaseResource, and that is not what is being deleted. What is being deleted is a proxy class, but haystack does not understand that a proxy class has no other data to harvest, so that it does not automagically harvest changes in BaseResource relative to the proxy classes. \r\n\r\nOne fix is to do the following;  \r\n1.\tCreate a custom subclass of RealtimeSignalProcessor.\r\n2.\tOverride RealtimeSignalProcessor.setup to register the proxy classes and other classes that influence resource content, e.g., ResourceAccess. These should also trigger updates to BaseResource SOLR data. \r\n3.\tOverride RealtimeSignalProcessor.update and delete to appropriately harvest or delete from the BaseResource SearchAPI instead of the proxy classes (by using super()).\r\n4.\tOverride RealtimeSignalProcess.teardown to delete BaseResource rather than proxy classes. \r\n"},"comment":{"url":"https://api.github.com/repos/hydroshare/hydroshare/issues/comments/216222469","html_url":"https://github.com/hydroshare/hydroshare/issues/1164#issuecomment-216222469","issue_url":"https://api.github.com/repos/hydroshare/hydroshare/issues/1164","id":216222469,"user":{"login":"jbradberry","id":685957,"avatar_url":"https://avatars.githubusercontent.com/u/685957?v=3","gravatar_id":"","url":"https://api.github.com/users/jbradberry","html_url":"https://github.com/jbradberry","followers_url":"https://api.github.com/users/jbradberry/followers","following_url":"https://api.github.com/users/jbradberry/following{/other_user}","gists_url":"https://api.github.com/users/jbradberry/gists{/gist_id}","starred_url":"https://api.github.com/users/jbradberry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbradberry/subscriptions","organizations_url":"https://api.github.com/users/jbradberry/orgs","repos_url":"https://api.github.com/users/jbradberry/repos","events_url":"https://api.github.com/users/jbradberry/events{/privacy}","received_events_url":"https://api.github.com/users/jbradberry/received_events","type":"User","site_admin":false},"created_at":"2016-05-02T12:27:24Z","updated_at":"2016-05-02T12:27:24Z","body":"The proper way to make sure that your indexing only pulls in the items that you want is to override `index_queryset`, using the exact filter statements necessary.  In this case it sounds like you would want something like\r\n\r\n        def index_queryset(self, using=None):\r\n            return self.get_model().objects.filter(discoverable=True)"}}