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

added protocol needed by searchable objects

parent 8cb512a3
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
__doc__='''Simple column indexes __doc__='''Simple column indexes
$Id: Index.py,v 1.8 1997/09/23 16:46:48 jim Exp $''' $Id: Index.py,v 1.9 1997/09/26 22:21:43 jim Exp $'''
__version__='$Revision: 1.8 $'[11:-2] __version__='$Revision: 1.9 $'[11:-2]
from BTree import BTree from BTree import BTree
from intSet import intSet from intSet import intSet
...@@ -113,7 +113,7 @@ class Index: ...@@ -113,7 +113,7 @@ class Index:
set.remove(i) set.remove(i)
except KeyError: pass 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 """Apply the index to query parameters given in the argument, request
The argument should be a mapping object. The argument should be a mapping object.
...@@ -128,8 +128,11 @@ class Index: ...@@ -128,8 +128,11 @@ class Index:
""" """
id=self.id id=self.id
try: keys=request[id]
except: return None try: keys=request["%s/%s" % (cid,id)]
except:
try: keys=request[id]
except: return None
if type(keys) is not ListType: keys=[keys] if type(keys) is not ListType: keys=[keys]
index=self._index index=self._index
...@@ -153,6 +156,9 @@ class Index: ...@@ -153,6 +156,9 @@ class Index:
############################################################################## ##############################################################################
# #
# $Log: Index.py,v $ # $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 # Revision 1.8 1997/09/23 16:46:48 jim
# Added logic to handle missing data. # Added logic to handle missing data.
# #
......
...@@ -127,8 +127,8 @@ Notes on a new text index design ...@@ -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 $''' $Id: TextIndex.py,v 1.4 1997/09/26 22:21:44 jim Exp $'''
__version__='$Revision: 1.3 $'[11:-2] __version__='$Revision: 1.4 $'[11:-2]
from Globals import Persistent from Globals import Persistent
from Trie import Trie from Trie import Trie
...@@ -248,7 +248,7 @@ class TextIndex(Persistent): ...@@ -248,7 +248,7 @@ class TextIndex(Persistent):
return r 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 """Apply the index to query parameters given in the argument, request
The argument should be a mapping object. The argument should be a mapping object.
...@@ -262,9 +262,13 @@ class TextIndex(Persistent): ...@@ -262,9 +262,13 @@ class TextIndex(Persistent):
all data fields used. all data fields used.
""" """
id=self.id id=self.id
try: keys=request[id]
except: return None try: keys=request["%s/%s" % (cid,id)]
except:
try: keys=request[id]
except: return None
if type(keys) is not ListType: keys=[keys] if type(keys) is not ListType: keys=[keys]
r=None r=None
...@@ -289,6 +293,9 @@ class TextIndex(Persistent): ...@@ -289,6 +293,9 @@ class TextIndex(Persistent):
############################################################################## ##############################################################################
# #
# $Log: TextIndex.py,v $ # $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 # Revision 1.3 1997/09/17 17:53:32 jim
# Added unindex_item. # Added unindex_item.
# This thing needs an overhaul; already. :-( # 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