[Zope3-checkins] CVS: Zope3/src/zope/keywordindex - ikeywordindex.py:1.1.2.1

Andreas Jung andreas@andreas-jung.com
Sat, 12 Jul 2003 04:19:28 -0400


Update of /cvs-repository/Zope3/src/zope/keywordindex
In directory cvs.zope.org:/tmp/cvs-serv14057

Added Files:
      Tag: ajung-keywordindex-branch
	ikeywordindex.py 
Log Message:
added


=== Added File Zope3/src/zope/keywordindex/ikeywordindex.py ===
##############################################################################
#
# Copyright (c) 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################

"""KeywordIndex Interface."""

from zope.interface import Interface

class IKeywordIndex(Interface):
    """Interface for a KeywordIndex."""

    def documentCount():
        """Return the number of documents in the index."""

    def search(query, operator='and'):
        """Execute a search given by 'query' as a list/tuple of
           (unicode) strings against the index. 'operator' can be either
           'and' or 'or' to search for all keywords or any keyword. 

           Return an IISet of docids
        """

    def index_doc(docid, seq):
        """index the sequence 'seq' for a given docid.  'seq' must be either a
           tuple or a list of (unicode) strings.
        """

    def unindex_doc(docid):
        """unindex document with document ID docid """

    def has_doc(docid):
        """Returns true if docid is an id of a document in the index"""