Commit 41a60a0c authored by Jim Fulton's avatar Jim Fulton

added protocol needed by searchable objects

parent 8cb512a3
......@@ -10,8 +10,8 @@
__doc__='''Simple column indexes
$Id: Index.py,v 1.8 1997/09/23 16:46:48 jim Exp $'''
__version__='$Revision: 1.8 $'[11:-2]
$Id: Index.py,v 1.9 1997/09/26 22:21:43 jim Exp $'''
__version__='$Revision: 1.9 $'[11:-2]
from BTree import BTree
from intSet import intSet
......@@ -113,7 +113,7 @@ class Index:
set.remove(i)
except KeyError: pass
def _apply_index(self, request):
def _apply_index(self, request, cid=''):
"""Apply the index to query parameters given in the argument, request
The argument should be a mapping object.
......@@ -128,6 +128,9 @@ class Index:
"""
id=self.id
try: keys=request["%s/%s" % (cid,id)]
except:
try: keys=request[id]
except: return None
......@@ -153,6 +156,9 @@ class Index:
##############################################################################
#
# $Log: Index.py,v $
# Revision 1.9 1997/09/26 22:21:43 jim
# added protocol needed by searchable objects
#
# Revision 1.8 1997/09/23 16:46:48 jim
# Added logic to handle missing data.
#
......
......@@ -127,8 +127,8 @@ Notes on a new text index design
$Id: TextIndex.py,v 1.3 1997/09/17 17:53:32 jim Exp $'''
__version__='$Revision: 1.3 $'[11:-2]
$Id: TextIndex.py,v 1.4 1997/09/26 22:21:44 jim Exp $'''
__version__='$Revision: 1.4 $'[11:-2]
from Globals import Persistent
from Trie import Trie
......@@ -248,7 +248,7 @@ class TextIndex(Persistent):
return r
def _apply_index(self, request,ListType=[]):
def _apply_index(self, request,cid='',ListType=[]):
"""Apply the index to query parameters given in the argument, request
The argument should be a mapping object.
......@@ -262,7 +262,11 @@ class TextIndex(Persistent):
all data fields used.
"""
id=self.id
try: keys=request["%s/%s" % (cid,id)]
except:
try: keys=request[id]
except: return None
......@@ -289,6 +293,9 @@ class TextIndex(Persistent):
##############################################################################
#
# $Log: TextIndex.py,v $
# Revision 1.4 1997/09/26 22:21:44 jim
# added protocol needed by searchable objects
#
# Revision 1.3 1997/09/17 17:53:32 jim
# Added unindex_item.
# This thing needs an overhaul; already. :-(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment