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
789fdad0
Commit
789fdad0
authored
May 27, 2005
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made 'and' operator for KeywordIndexes actually restrict results as expected.
Collector #889 -- thanks to 'aroda' for the patch!
parent
c00414cf
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
4 deletions
+38
-4
doc/CHANGES.txt
doc/CHANGES.txt
+6
-0
lib/python/Products/PluginIndexes/KeywordIndex/tests/testKeywordIndex.py
...ucts/PluginIndexes/KeywordIndex/tests/testKeywordIndex.py
+27
-0
lib/python/Products/PluginIndexes/common/UnIndex.py
lib/python/Products/PluginIndexes/common/UnIndex.py
+5
-4
No files found.
doc/CHANGES.txt
View file @
789fdad0
...
...
@@ -22,6 +22,12 @@ Zope Changes
- Collector #1233: port ZOPE_CONFIG patch from Zope 2.7 to Zope 2.8
After Zope 2.8.0 b2
Bugs Fixed
- Collector #889: made 'and' operator for KeywordIndexes actually
restrict results as expected (thanks to 'aroda' for the patch!).
Zope 2.8.0 b2 (2005/05/22)
...
...
lib/python/Products/PluginIndexes/KeywordIndex/tests/testKeywordIndex.py
View file @
789fdad0
...
...
@@ -221,6 +221,33 @@ class TestKeywordIndex( unittest.TestCase ):
finally
:
self
.
_ignore_log_errors
()
def
testCollectorIssue889
(
self
)
:
# Test that collector issue 889 is solved
values
=
self
.
_values
nonexistent
=
'foo-bar-baz'
self
.
_populateIndex
()
# make sure key is not indexed
result
=
self
.
_index
.
_index
.
get
(
nonexistent
,
self
.
_marker
)
assert
result
is
self
.
_marker
# patched _apply_index now works as expected
record
=
{
'foo'
:
{
'query'
:
[
nonexistent
]
,
'operator'
:
'and'
}
}
self
.
_checkApply
(
record
,
[])
record
=
{
'foo'
:
{
'query'
:
[
nonexistent
,
'a'
]
,
'operator'
:
'and'
}
}
# and does not break anything
self
.
_checkApply
(
record
,
[])
record
=
{
'foo'
:
{
'query'
:
[
'd'
]
,
'operator'
:
'and'
}
}
self
.
_checkApply
(
record
,
values
[
4
:
5
])
record
=
{
'foo'
:
{
'query'
:
[
'a'
,
'e'
]
,
'operator'
:
'and'
}
}
self
.
_checkApply
(
record
,
values
[
5
:
7
])
def
test_suite
():
suite
=
unittest
.
TestSuite
()
suite
.
addTest
(
unittest
.
makeSuite
(
TestKeywordIndex
)
)
...
...
lib/python/Products/PluginIndexes/common/UnIndex.py
View file @
789fdad0
...
...
@@ -363,8 +363,9 @@ class UnIndex(SimpleItem):
else
:
# not a range search
for
key
in
record
.
keys
:
set
=
index
.
get
(
key
,
None
)
if
set
is
not
None
:
if
isinstance
(
set
,
int
):
if
set
is
None
:
set
=
IISet
(())
elif
isinstance
(
set
,
int
):
set
=
IISet
((
set
,))
r
=
set_func
(
r
,
set
)
...
...
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