[Zope3-checkins]
SVN: Zope3/branches/jim-index-restructure-2004-12/src/zope/index/
Changed indexes using sets to use IFSets rather than IISets.
Jim Fulton
jim at zope.com
Thu Dec 9 14:41:56 EST 2004
Log message for revision 28602:
Changed indexes using sets to use IFSets rather than IISets.
This is needed ebcause we have switched to using floating-point
scores.
Changed:
U Zope3/branches/jim-index-restructure-2004-12/src/zope/index/field/README.txt
U Zope3/branches/jim-index-restructure-2004-12/src/zope/index/field/index.py
U Zope3/branches/jim-index-restructure-2004-12/src/zope/index/interfaces.py
-=-
Modified: Zope3/branches/jim-index-restructure-2004-12/src/zope/index/field/README.txt
===================================================================
--- Zope3/branches/jim-index-restructure-2004-12/src/zope/index/field/README.txt 2004-12-09 19:20:03 UTC (rev 28601)
+++ Zope3/branches/jim-index-restructure-2004-12/src/zope/index/field/README.txt 2004-12-09 19:41:55 UTC (rev 28602)
@@ -24,26 +24,26 @@
with a minimum and maximum value:
>>> index.apply((30, 70))
- IISet([3, 4, 5, 7, 8])
+ IFSet([3, 4, 5, 7, 8])
Open-ended ranges can be provided by provinding None as an end point:
>>> index.apply((30, None))
- IISet([2, 3, 4, 5, 6, 7, 8])
+ IFSet([2, 3, 4, 5, 6, 7, 8])
>>> index.apply((None, 70))
- IISet([0, 1, 3, 4, 5, 7, 8, 9])
+ IFSet([0, 1, 3, 4, 5, 7, 8, 9])
>>> index.apply((None, None))
- IISet([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
+ IFSet([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
To do an exact value search, supply equal minimum and maximum values:
>>> index.apply((30, 30))
- IISet([4, 7])
+ IFSet([4, 7])
>>> index.apply((70, 70))
- IISet([])
+ IFSet([])
Field indexes support basic statistics:
@@ -55,13 +55,13 @@
Documents can be reindexed:
>>> index.apply((15, 15))
- IISet([9])
+ IFSet([9])
>>> index.index_doc(9, 14)
>>> index.apply((15, 15))
- IISet([])
+ IFSet([])
>>> index.apply((14, 14))
- IISet([9])
+ IFSet([9])
Documents can be unindexed:
@@ -77,7 +77,7 @@
7
>>> index.apply((30, 70))
- IISet([3, 4, 5])
+ IFSet([3, 4, 5])
Unindexing a document id that isn't present is ignored:
@@ -97,4 +97,4 @@
0
>>> index.apply((30, 70))
- IISet([])
+ IFSet([])
Modified: Zope3/branches/jim-index-restructure-2004-12/src/zope/index/field/index.py
===================================================================
--- Zope3/branches/jim-index-restructure-2004-12/src/zope/index/field/index.py 2004-12-09 19:20:03 UTC (rev 28601)
+++ Zope3/branches/jim-index-restructure-2004-12/src/zope/index/field/index.py 2004-12-09 19:41:55 UTC (rev 28602)
@@ -19,7 +19,7 @@
from BTrees.IOBTree import IOBTree
from BTrees.OOBTree import OOBTree
-from BTrees.IIBTree import IITreeSet, IISet, multiunion
+from BTrees.IFBTree import IFTreeSet, IFSet, multiunion
from BTrees.Length import Length
import zope.interface
@@ -63,7 +63,7 @@
# Insert into forward index.
set = self._fwd_index.get(value)
if set is None:
- set = IITreeSet()
+ set = IFTreeSet()
self._fwd_index[value] = set
set.insert(docid)
Modified: Zope3/branches/jim-index-restructure-2004-12/src/zope/index/interfaces.py
===================================================================
--- Zope3/branches/jim-index-restructure-2004-12/src/zope/index/interfaces.py 2004-12-09 19:20:03 UTC (rev 28601)
+++ Zope3/branches/jim-index-restructure-2004-12/src/zope/index/interfaces.py 2004-12-09 19:41:55 UTC (rev 28602)
@@ -70,10 +70,10 @@
A result is returned that is:
- - An IIBTree or an IIBucket mapping document ids to integer
+ - An IFBTree or an IFBucket mapping document ids to floating-point
scores for document ids of documents that match the query,
- - An IISet or IITreeSet containing document ids of documents
+ - An IFSet or IFTreeSet containing document ids of documents
that match the query, or
- None, indicating that the index could not use the query and
More information about the Zope3-Checkins
mailing list