zopefoundation / Products.ZCatalog

Zope's indexing and search solution.
Other
5 stars 22 forks source link

Searches with "not" in a KeywordIndex do not return records that do not contain a value for the index #148

Open wesleybl opened 7 months ago

wesleybl commented 7 months ago

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: https://github.com/plone/Products.CMFPlone/issues/3895

What I did:

  1. Create a document with the Tag: "Bulletin"
  2. Create a Python script in ZMI with the content:
return str(context.portal_catalog(Subject={"not": ["Bulletin"]}))
  1. Run the script multiple times.

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