4teamwork / ftw.solr

Solr integration for Plone
5 stars 5 forks source link

Make sure to always update 'path_depth' if 'path' is (re)indexed. #134

Closed lukasgraf closed 5 years ago

lukasgraf commented 5 years ago

This is a follow-up to #132 where support for indexing path depth was added.

We need to make sure to always update path_depth as well if path is (re)indexed:

In some cases, the path catalog index will be updated for an object specifically by passing path in the list of idxs of a reindexObject() call. One such case is moving an object while ftw.copymovepatches is installed.

Because path_depth is not a Plone catalog index, it will not be listed in these cases (by Plone or a Plone addon product). It still needs to be updated though in those cases, because it's contents are functionally dependent on the object's path.

We therefore make sure to always add path_depth to the list of attributes to be indexed if path is already in there (and we're not doing a full reindex).