Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
41a60a0c
Commit
41a60a0c
authored
Sep 26, 1997
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added protocol needed by searchable objects
parent
8cb512a3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
10 deletions
+23
-10
lib/python/SearchIndex/Index.py
lib/python/SearchIndex/Index.py
+11
-5
lib/python/SearchIndex/TextIndex.py
lib/python/SearchIndex/TextIndex.py
+12
-5
No files found.
lib/python/SearchIndex/Index.py
View file @
41a60a0c
...
@@ -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.
#
#
...
...
lib/python/SearchIndex/TextIndex.py
View file @
41a60a0c
...
@@ -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. :-(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment