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
9032867d
Commit
9032867d
authored
May 17, 2002
by
Tim Peters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement correct (albeit inefficient) reindexing, and stop cheating
in the reindexing text.
parent
eebb1a61
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
5 deletions
+4
-5
lib/python/Products/ZCTextIndex/BaseIndex.py
lib/python/Products/ZCTextIndex/BaseIndex.py
+3
-1
lib/python/Products/ZCTextIndex/tests/testZCTextIndex.py
lib/python/Products/ZCTextIndex/tests/testZCTextIndex.py
+1
-4
No files found.
lib/python/Products/ZCTextIndex/BaseIndex.py
View file @
9032867d
...
...
@@ -84,7 +84,9 @@ class BaseIndex(Persistent):
# A subclass may wish to extend or override this.
def
index_doc
(
self
,
docid
,
text
):
# XXX If docid is already known, do something smart.
if
self
.
_docwords
.
has_key
(
docid
):
# XXX Do something smarter than this.
self
.
unindex_doc
(
docid
)
wids
=
self
.
_lexicon
.
sourceToWordIds
(
text
)
wid2weight
,
docweight
=
self
.
_get_frequencies
(
wids
)
for
wid
,
weight
in
wid2weight
.
items
():
...
...
lib/python/Products/ZCTextIndex/tests/testZCTextIndex.py
View file @
9032867d
...
...
@@ -96,7 +96,7 @@ class ZCIndexTestsBase:
self
.
assertEqual
(
len
(
self
.
index
.
get_words
(
1
)),
1
)
def
testDocUpdate
(
self
):
docid
=
1
docid
=
1
# doesn't change -- we index the same doc repeatedly
N
=
len
(
text
)
stop
=
get_stopdict
()
...
...
@@ -131,9 +131,6 @@ class ZCIndexTestsBase:
for w in v:
nbest, total = self.zc_index.query(w)
self.assertEqual(total, 0, "
did
not
expect
to
find
%
s
" % w)
# XXX The next line is necessary because we're not yet reindexing
# XXX docs correctly.
self.zc_index.unindex_object(docid)
class CosineIndexTests(ZCIndexTestsBase, testIndex.CosineIndexTest):
...
...
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