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
c6fb0765
Commit
c6fb0765
authored
Sep 28, 1998
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug in searches on stop words.
parent
d0487f77
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
lib/python/SearchIndex/TextIndex.py
lib/python/SearchIndex/TextIndex.py
+10
-4
No files found.
lib/python/SearchIndex/TextIndex.py
View file @
c6fb0765
...
...
@@ -127,8 +127,8 @@ Notes on a new text index design
$Id: TextIndex.py,v 1.1
0 1998/02/05 19:02:09
jim Exp $'''
__version__
=
'$Revision: 1.1
0
$'
[
11
:
-
2
]
$Id: TextIndex.py,v 1.1
1 1998/09/28 20:43:22
jim Exp $'''
__version__
=
'$Revision: 1.1
1
$'
[
11
:
-
2
]
from
Globals
import
Persistent
import
BTree
,
IIBTree
...
...
@@ -272,6 +272,7 @@ class TextIndex(Persistent):
"""Return an InvertedIndex-style result "list"
"""
src
=
tuple
(
Splitter
(
word
,
self
.
_syn
))
if
not
src
:
return
ResultList
({},(
word
,),
self
)
if
len
(
src
)
==
1
:
src
=
src
[
0
]
if
src
[:
1
]
==
'"'
and
src
[
-
1
:]
==
'"'
:
return
self
[
src
]
...
...
@@ -309,7 +310,9 @@ class TextIndex(Persistent):
elif
has_key
(
id
):
keys
=
request
[
id
]
else
:
return
None
if
type
(
keys
)
is
not
ListType
:
keys
=
[
keys
]
if
type
(
keys
)
is
type
(
''
):
if
not
keys
or
not
strip
(
keys
):
return
None
keys
=
[
keys
]
r
=
None
for
key
in
keys
:
key
=
strip
(
key
)
...
...
@@ -325,7 +328,7 @@ class TextIndex(Persistent):
r
=
r
.
intersection
(
rr
)
if
r
is
not
None
:
return
r
,
(
id
,)
return
intSet
(),
(
id
,)
class
ResultList
:
...
...
@@ -626,6 +629,9 @@ for word in stop_words: stop_word_dict[word]=None
##############################################################################
#
# $Log: TextIndex.py,v $
# Revision 1.11 1998/09/28 20:43:22 jim
# Fixed bug in searches on stop words.
#
# Revision 1.10 1998/02/05 19:02:09 jim
# Changed to use get method.
#
...
...
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