are not patched by collective.solr and thus work on the standard ZCatalog. Some methods, e.g. reindexObjectSecurity(), rely on them to reindex objects. When clearing the standard Catalog and using solr for all indexes, this fails silently because said methods get no results from ZCatalog and don't reindex anything.
By patching the methods like this we were able to fix the issue:
def unrestrictedSearchResults(self, REQUEST=None, **kw):
kw = kw.copy()
only_active = not kw.get('show_inactive', False)
if only_active and not _checkPermission(AccessInactivePortalContent, self):
kw['effectiveRange'] = DateTime()
# support collective.indexing's "auto-flush" feature
# see http://dev.plone.org/collective/changeset/73602
autoFlushQueue(hint='restricted/solr search', request=REQUEST, **kw)
adapter = queryAdapter(self, ISearchDispatcher)
if adapter is not None:
return adapter(REQUEST, **kw)
return self._cs_old_searchResults(REQUEST, **kw)
def reindexObject(self, object, idxs=, update_metadata=1, uid=None):
manager = queryUtility(ISolrConnectionManager)
proc = SolrIndexProcessor(manager)
proc.reindex(object, attributes=idxs or None)
""" monkey patch plone's catalogtool with the solr dispatcher """
CatalogTool._cs_old_searchResults = CatalogTool.searchResults
CatalogTool.searchResults = searchResults
CatalogTool.unrestrictedSearchResults = unrestrictedSearchResults
CatalogTool.reindexObject = reindexObject
CatalogTool.__call__ = searchResults
I added the patch for unrestrictedSearchResults in db7afe2 - and fixed it to fall back on the unrestrictedSearchResults method of the catalog instead of searchResults.
Dispatching reindexObject is actually "wrong". This is a ZCatalog API, and we cannot simply ignore updating ZCatalog. Moving all indexes over to Solr is also not supported. You need at least the UID index in the ZCatalog.
But in general you probably don't want to loose transactional integrity for most queries, except for full text search.