-
Notifications
You must be signed in to change notification settings - Fork 21
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
Searches with "not" in a KeywordIndex do not return records that do not contain a value for the index #148
Comments
Actually it is more difficult. We (me and @gogobd) run into the same issue. We are using a query where one part is Next we found the order of indexes the query plan returns alternates too. One call the
Since an index only knows about values it has indexed, excluding documents with no such value or no such attribute, it is a completely different result. We wrote a (failing) test to demonstrate this in branch |
Like @jensens just explainded we had a problem with "not" in combination with "KeywordIndex". The internal order of the individual keyword indices changes the result. When the "not" KeywordIndex query is done first it "misses" all objects that don't even have that index - but those objects should be part of the result, because they fullfill the "not" requirement. So if the Catalog "Plan" switches the individual queries the result changes. |
We "fixed" this issue by providing an indexer for all Dexterity Types that would index an "empty marker" if no value is present. That way the "not" query can "see" all content - even the content that doesn't even have the indexed field, in our case it is called "internal_tags".
|
BUG/PROBLEM REPORT / FEATURE REQUEST
Searches with "not" in a
KeywordIndex
do not return records that do not contain a value for the index. For example, Plone's index Subject.See this issue: plone/Products.CMFPlone#3895
What I did:
What I expect to happen:
The search must return all content that does not contain the "Bulletin" Subject. Including objects that do not have any Subject.
What actually happened:
Content that does not have a Subject is not returned.
What version of Python and Zope/Addons I am using:
Zope 5.9
Python: 3.11
The text was updated successfully, but these errors were encountered: