[Zope-dev] SearchIndex/ZCatalog comments.

2001-06-15 Thread Erik Enge

When writing the PossitionIndex, a bunch of questions arrised (Zope
2.3.2):

This is from UnTextIndex.py Zope 2.3.2 line 250 (or there abouts).
Why is the wordMap needed?


def getEntryForObject(self, rid, default=None):
Get all information contained for a specific object.

This takes the objects record ID as it's main argument.

wordMap = self.getLexicon(self._lexicon)._lexicon.items()
results = self._unindex.get(rid, None)

if results is None:
return default
else:
return tuple(map(self.getLexicon(self._lexicon).getWord,
 results))



I thought we didn't make it into a BTree 'till it was  5?:


else:
if indexRow.get(documentId, -1) != score:
# score changed (or new entry)

if type(indexRow) is DictType:
indexRow[documentId] = score
if len(indexRow)  3:
# Big enough to give it's own database record
indexRow=IIBTree(indexRow) 
index[entry] = indexRow
else:
indexRow[documentId] = score


shouldn't objects be object?:


def index_object(self, documentId, obj, threshold=None):
 Index an object:
'documentId' is the integer id of the document

'obj' is the objects to be indexed


do we need this is ZCatalog.py?:


from SearchIndex import UnIndex, UnTextIndex 


this isn't true?  what about keywordindexes (only 'Field' and 'Text'
mentioned)?:


class ZCatalog(Folder, Persistent, Implicit):
ZCatalog object

A ZCatalog contains arbirary index like references to Zope
objects.  ZCatalog's can index either 'Field' values of object, or 
'Text' values.


do we need this in UnTextIndex.py?:


from Splitter import Splitter


from ResultList.py:


def __or__(self, x):
return self.__class__(
weightedUnion(self._dict, x._dict)[1],
union(self._words, x._words),
self._index,
)
return self.__class__(result, self._words+x._words, self._index)


two returns?

Sorry if this is all mambo-jambo, or if it is already fixed in 2.4.


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] SearchIndex/ZCatalog comments.

2001-06-15 Thread Chris McDonough

Erik Enge wrote: 
 When writing the PossitionIndex, a bunch of questions arrised (Zope
 2.3.2):
 
 This is from UnTextIndex.py Zope 2.3.2 line 250 (or there abouts).
 Why is the wordMap needed?

Doesn't look like it is.  I removed this line in the trunk
PluggableIndexes code.

 I thought we didn't make it into a BTree 'till it was  5?:

I changed the comment (rather than the code) in the trunk.

 shouldn't objects be object?:

Fixed in the trunk PluggableIndexes code.

 do we need this is ZCatalog.py?:
 
 
 from SearchIndex import UnIndex, UnTextIndex
 
 
 this isn't true?  what about keywordindexes (only 'Field' and 'Text'
 mentioned)?:

 do we need this in UnTextIndex.py?:
 
 
 from Splitter import Splitter
 

Pluggable indexes change this stuff significantly, so basically neither
of these errors exists on the trunk in the Pluggable index code.
 
 from ResultList.py:
 
 
 def __or__(self, x):
 return self.__class__(
 weightedUnion(self._dict, x._dict)[1],
 union(self._words, x._words),
 self._index,
 )
 return self.__class__(result, self._words+x._words, self._index)
 
 
 two returns?

This is also fixed now.

 
 Sorry if this is all mambo-jambo, or if it is already fixed in 2.4.

Many thanks!

- C


 
 ___
 Zope-Dev maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope-dev
 **  No cross posts or HTML encoding!  **
 (Related lists -
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope )

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )