[Zope3-checkins] CVS: Zope3/src/zope/index/topic - filter.py:1.2 index.py:1.2
Andreas Jung
andreas@andreas-jung.com
Thu, 17 Jul 2003 14:39:10 -0400
Update of /cvs-repository/Zope3/src/zope/index/topic
In directory cvs.zope.org:/tmp/cvs-serv6590/topic
Modified Files:
filter.py index.py
Log Message:
- added ITopicQuerying
- test for reindexing
- cleanup
=== Zope3/src/zope/index/topic/filter.py 1.1 => 1.2 ===
--- Zope3/src/zope/index/topic/filter.py:1.1 Wed Jul 16 13:06:00 2003
+++ Zope3/src/zope/index/topic/filter.py Thu Jul 17 14:38:35 2003
@@ -15,13 +15,18 @@
"""Filters for TopicIndexes"""
from zodb.btrees.IIBTree import IISet
-from zope.index.interfaces import ITopicFilter
+from zope.index.interfaces import ITopicFilteredSet
from zope.interface import implements
-class FilterBase:
- """ base class for all filters """
+class FilteredSetBase:
+ """ Base class for all filtered sets.
+
+ A filtered set is a collection of documents represented
+ by their document ids that match a common criteria given
+ by a condition.
+ """
- implements(ITopicFilter)
+ implements(ITopicFilteredSet)
def __init__(self, id, expr):
self.id = id
@@ -56,8 +61,8 @@
__str__ = __repr__
-class PythonFilter(FilterBase):
- """ a topic filter to check a context against a Python expression """
+class PythonFilteredSet(FilteredSetBase):
+ """ a topic filtered set to check a context against a Python expression """
def index_doc(self, docid, context):
=== Zope3/src/zope/index/topic/index.py 1.1 => 1.2 ===
--- Zope3/src/zope/index/topic/index.py:1.1 Wed Jul 16 13:16:23 2003
+++ Zope3/src/zope/index/topic/index.py Thu Jul 17 14:38:35 2003
@@ -12,7 +12,7 @@
#
##############################################################################
-"""Field index"""
+"""Topic index"""
from persistence import Persistent
@@ -22,19 +22,17 @@
from types import ListType, TupleType, StringTypes
from zope.interface import implements
-from zope.index.interfaces import IInjection
-
+from zope.index.interfaces import IInjection, ITopicQuerying
class TopicIndex(Persistent):
- implements(IInjection)
+ implements(IInjection, ITopicQuerying)
def __init__(self):
self.clear()
def clear(self):
- """Initialize forward and reverse mappings."""
- # The forward index maps indexed values to a sequence of docids
+ # mapping filter id -> filter
self._filters = OOBTree()
def addFilter(self, f ):