-
-
Notifications
You must be signed in to change notification settings - Fork 182
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
Intermittent error when using "not" when searching with index Subject #3895
Comments
In fact, the problem occurs even if the |
I debugged this error and came to the following conclusions:
But why does it sometimes work? Let's go:
So this problem can occur in all indexes where not all content has a value, not just with How to fix this problem? I could think about forcing the index Could we force indexes with "not" to always be last? Or do something like: If the search result is empty and the index contains a "not", search all records first. But how and where to do this? @mauritsvanrees @davisagli @mamico @jensens I'm mentioning you because you recently messed with |
In fact, @dataflake @icemac any thoughts here? |
The index is not in Zope, it's in Products.CMFCore where the only "consumer" is Plone. I am not a ZCatalog expert, sorry. |
@wesleybl I think changing the order of the indexes should mitigate the problem, but in the end it won't be the real solution. However, if you want to experiment, you can do so by monkey-patching the method In the meantime, I would try opening an issue or a PR (starting with a test that breaks) on I also see a similar problem, not the same one, here zopefoundation/Products.ZCatalog#35 and some work done, but probably not fully completed, here zopefoundation/Products.ZCatalog#74 |
@mamico I think this would solve the problem in a simpler way. At least it would solve the problem for those using Any other solution would be more complex and would have to allow returning all objects in the catalog before applying the filter with not. |
BUG/PROBLEM REPORT (OR OTHER COMMON ISSUE)
When we do a search in the
Subject
index, with "not", the result is sometimes wrong. Sometimes it returns an empty list, when it should return content.What I did:
What I expect to happen:
The search must return all content that does not contain the "Bulletin" Tag
What actually happened:
Sometimes an empty list is returned.
What version of Plone/ Addons I am using:
Plone 6.0.9
The text was updated successfully, but these errors were encountered: