Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metadata doesn't get updated when idxs is specified in reindexObject call #136

Open
lukasgraf opened this issue Jul 25, 2019 · 1 comment

Comments

@lukasgraf
Copy link
Contributor

If any code calls context.reindexObject(idxs=['...']) with a list of indexes, ftw.solr only updates those fields, but not ones that correspond to catalog metadata.

This is in opposition to the catalog's behavior, which will always update metadata on any context.reindexObject() call.

This becomes a problem when code is relying on the fact that this is the catalog's behavior, and picks a cheap index like getId to accomplish a reindexing of basically just the metadata. This "use a cheap index" trick is used by ftw.bumblebee for example.

It's unfortunate that the catalog behaves this way, and doesn't provide a clean API to control updating of metadata. But because of that, it's a fact that there's plenty of code around that either deliberately abuses that side-effect of reindexObject(), or at least needs it to work properly.

In my opinion, the default out-of-the box behavior in ftw.solr needs to prioritize consistency.

Unfortunately, fixing this behavior in ftw.solr means that we probably will incur quite a performance penalty. Atomic updates would be much less "atomic" than before, because they would always need to include all metadata fields as well (=fields in the Solr schema for which a Plone catalog metadata column exists with the same name).

@lukasgraf
Copy link
Contributor Author

lukasgraf commented Aug 8, 2019

As discussed:
For now, we will address this by specifically adding the name of the metadata column to be indexed to the respective reindexObject() calls' list of idxs.
This will lead to the ZCatalog quietly filtering out index names it doesn't know about, and the name of the metadata columns still getting passed on to ftw.solr (which doesn't make a distinction between metadata and indexes anyway).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant