[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/QueryInterfaces - QueryInterfaces.py:1.2

Christian Theune ct@gocept.com
Wed, 4 Dec 2002 05:42:28 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/QueryInterfaces
In directory cvs.zope.org:/tmp/cvs-serv20999

Modified Files:
	QueryInterfaces.py 
Log Message:
- Fixed module comment
- Cleaned up the interfaces a bit


=== Zope3/lib/python/Zope/App/QueryInterfaces/QueryInterfaces.py 1.1 => 1.2 ===
--- Zope3/lib/python/Zope/App/QueryInterfaces/QueryInterfaces.py:1.1	Tue Dec  3 11:28:27 2002
+++ Zope3/lib/python/Zope/App/QueryInterfaces/QueryInterfaces.py	Wed Dec  4 05:42:27 2002
@@ -11,13 +11,20 @@
 # FOR A PARTICULAR PURPOSE.
 # 
 ##############################################################################
-"""XXX short summary goes here.
+"""Standard interfaces for using the query service.
 
-XXX longer description goes here.
+The query service provides a set of interfaces for articulating queries. You
+can create complex queries by implementing multiple interfaces like
+IBatchedQuery and ITextIndexQuery to ask the TextIndex for a batched query.
+The lookup for the query processor will try to find an appropriate adapter to
+the index.
 
 $Id$
 """
 
+from Interface import Interface
+from Interface.Attribute import Attribute
+
 class IQueryDescription(Interface):
     """An interface the describes the input or output of a
        query processor.
@@ -37,6 +44,13 @@
 
     startPosition = Attribute("The first element of the batch.")
     batchSize = Attribute("The size of the batch.")
+
+class IBatchedTextIndexQuery(IBatchedQuery, ITextIndexQuery):
+    pass
+
+class IBatchedResult(IBatchedQuery):
+
+    totalSize = Attribute("The total size of the result set if known.")
     
 class IHubIdSet(IQueryDescription):
     """Contains an IISet or IOSet of HubIds.
@@ -58,17 +72,17 @@
 
     instrumentalQuery = Attribute("Contains the instrumental query.")
 
+
 class IRankedObjectIterator(Interface):
     """Provides an iterable presentation of ranked results
-       of a ranked query.
+       of a ranked query. Each item is implementing an IRankedObjectRecord.
     """
 
-    class IRecord(Interface):
-        """One item returned by the iterator."""
-
-        rank = Attribute("A float between 0 and 1 inclusive.")
-        object = Attribute("The object.")
-
     def __iter__():
         """Iterates over the results."""
 
+class IRankedObjectRecord(Interface):
+    """One item returned by the iterator."""
+
+    rank = Attribute("A float between 0 and 1 inclusive.")
+    object = Attribute("The object.")