You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The CalDAV-protocol supports negated text matches, but this is not properly implemented in the current search functionality.
This requires some work:
In the caldav-server-tester project, it's needed to do some testing to check if the server supports it or not
In the icalendar-searcher project, it's needed to implement support for the != operator
In search.py, the build_search_xml_query should be fixed to support negated text matches
In search.py, we need a workaround for removing the attribute from the search and then do client-side filtering in cases where the server does not support negated text matches.
It's needed to add both unit tests and functional tests
Claude made an estimate that this task will take 12-16 hours. Let me think a bit:
The icaledar-searcher library does not support the != operator yet. Start by adding test code it (trivial, one hour)
The icalendar-searcher library has to be fixed to support != (trivial, one hour)
Unit tests on the modifications needed in build_search_xml_query. It may be non-trivial making a good test, but it should be easy making a simplified test - and if it's too complicated it may be skipped (one hour)
build_search_xml_query in search.py has to be modified to support. This should also be relatively trivial (search for if self._property_operator[property] == "undef" and add the logic in that area). One hour.
Does the server supports the logic? A new test case has to be made in the calendar-server-checker. (relatively trivial, should be one hour).
Test all the servers we have available for this feature, adjust the compatibility_hints.py. Time-consuming, but trivial. Two hours.
Fix functional tests in caldav_client.py. One hour.
Fix the CalDAVSearcher to fall back to client side search for servers not supporting negated searches (search.py is already ripe for refactoring #580 needs to be done first) . One hour.
Fight with all the servers and bang on things until the test code passes. Slightly non-trivial and time consuming. Two hours.
That adds up to 10 hours, including the work done on the sub-projects (caldav-server-tester, icalendar-searcher). Possibly less.
Disclaimer: AI-generated text below the line, generated by Claude Opus 5.5, from the prompt(s):
Issue #567 and #568 - and other search-related issues - please check if they are done and can be closed
Close #568 and update #545
Done in v3.5.0 (#750, with icalendar-searcher 1.1.0): add_property_filter() accepts != (alias <>), !contains and def. build_search_xml_query() renders !contains as a negated text-match, and != / def as a bare prop-filter.
search() currently leaves these operators out of the server query and filters client-side (unless post_filter=False), since no server has been probed for negate-condition support yet. A caldav-server-tester probe for that, letting search() send !contains to servers that honour it, is an optimisation, not a missing feature. It is recorded in docs/design/TODO.md.
Activity
tobixen commentedon Dec 5, 2025
Claude made an estimate that this task will take 12-16 hours. Let me think a bit:
build_search_xml_query. It may be non-trivial making a good test, but it should be easy making a simplified test - and if it's too complicated it may be skipped (one hour)build_search_xml_queryinsearch.pyhas to be modified to support. This should also be relatively trivial (search forif self._property_operator[property] == "undef"and add the logic in that area). One hour.compatibility_hints.py. Time-consuming, but trivial. Two hours.That adds up to 10 hours, including the work done on the sub-projects (caldav-server-tester, icalendar-searcher). Possibly less.
feat(search): negated and def property filters
docs: note the icalendar-searcher floor to raise
feat(search): negated and def property filters
docs: note server-side negated searches as TODO
feat(search): negated and def property filters
docs: note server-side negated searches as TODO
tobixen commentedon Oct 20, 2026
Disclaimer: AI-generated text below the line, generated by Claude Opus 5.5, from the prompt(s):
Done in v3.5.0 (#750, with icalendar-searcher 1.1.0):
add_property_filter()accepts!=(alias<>),!containsanddef.build_search_xml_query()renders!containsas a negatedtext-match, and!=/defas a bareprop-filter.search()currently leaves these operators out of the server query and filters client-side (unlesspost_filter=False), since no server has been probed fornegate-conditionsupport yet. A caldav-server-tester probe for that, lettingsearch()send!containsto servers that honour it, is an optimisation, not a missing feature. It is recorded indocs/design/TODO.md.Closing.