I have started testing my product in Zope 2.6.1b1 and notice an odd behaviour My code looks something like this: catalog = self.ICatalog # an instance of ZCatalog called ICatalog I have results1 = catalog() print results1 # returns 25 as expected results2 = catalog({'email':'peter'}) # ...in Zope 2.5.0 print len(results2) # returns 2 as expected # ...in Zope 2.6.1b1 print len(results2) # returns 25, i.e. as if the 'email' index is ignored!!! Why this strange behaviour? A bug in Zope2.6.1b1 ? How do I go around it? I tried the mailinglist but failed to find the discussion. I also tried inspecting the code but didn't understand anything. Peter
Peter Bengtsson wrote:
# ...in Zope 2.6.1b1 print len(results2) # returns 25, i.e. as if the 'email' index is ignored!!!
Why this strange behaviour? A bug in Zope2.6.1b1 ?
What kind of index is 'email'? cheers, Chris
At 18:26 2003-01-09 +0000, Chris Withers wrote:
Peter Bengtsson wrote:
# ...in Zope 2.6.1b1 print len(results2) # returns 25, i.e. as if the 'email' index is ignored!!! Why this strange behaviour? A bug in Zope2.6.1b1 ?
What kind of index is 'email'?
It's TextIndex. (Should I maybe use the new ZCTextIndex now?) zcatalog = self.getCatalog() pluginindexes = zcatalog.Indexes.manage_addProduct['PluginIndexes'] pluginindexes.manage_addTextIndex('email')
cheers,
Chris
Peter Bengtsson wrote:
What kind of index is 'email'?
It's TextIndex.
(Should I maybe use the new ZCTextIndex now?)
If you want, it doesn't maek a differnce.
zcatalog = self.getCatalog() pluginindexes = zcatalog.Indexes.manage_addProduct['PluginIndexes'] pluginindexes.manage_addTextIndex('email')
This code doesn't look that great. Are you sure sure 'email' is being created? Why not just use this code? self.getCatalog().addIndex('email','TextIndex') cheers, Chris
At 12:08 2003-01-14 +0000, Chris Withers wrote:
Peter Bengtsson wrote:
What kind of index is 'email'? It's TextIndex. (Should I maybe use the new ZCTextIndex now?)
If you want, it doesn't maek a differnce.
Ok. Cheers.
zcatalog = self.getCatalog() pluginindexes = zcatalog.Indexes.manage_addProduct['PluginIndexes'] pluginindexes.manage_addTextIndex('email')
This code doesn't look that great. Are you sure sure 'email' is being created?
Why not just use this code?
self.getCatalog().addIndex('email','TextIndex')
Doesn't matter, but I'll apply this code instead since it looks better. The TextIndex is surely created and is populated with content as objects get cataloged. The code hasn't changed since I installed Zope2.6.1b1 and it was working before. It's quite obviously either one of these: - Bug in Zope2.6.1b1 or - Bug in Zope2.6.1b1 ZCatalog's backward compatability (could be intentional by the zcorp people) Thank you again for thinking about this. Very valuable support. Peter
Peter Bengtsson wrote:
- Bug in Zope2.6.1b1
No one else has reported anything like this.
- Bug in Zope2.6.1b1 ZCatalog's backward compatability (could be intentional by the zcorp people)
Definitely not. cheers, Chris
At 17:24 2003-01-15 +0000, Chris Withers wrote:
Peter Bengtsson wrote:
- Bug in Zope2.6.1b1
No one else has reported anything like this.
- Bug in Zope2.6.1b1 ZCatalog's backward compatability (could be intentional by the zcorp people)
Definitely not.
But the code hasn't changed! It's my product that was working fine before. Now I just installed zope2.6.1b1 on my winXP and it started to ignore some indexes. I will try to reproduce it again strictly without touching any code and go through exactly the same steps on both servers and come back to you. Peter
Found why!! The reason was this. Before, i.e. before Zope2.6.1b1 id (fieldindex) and title (textindex) was automatically created when you set up a catalog. That and some other indexes. Not in Zope 2.6.1b1 so I had to do that "manually". Thank you for the support Peter At 17:24 2003-01-15 +0000, Chris Withers wrote:
Peter Bengtsson wrote:
- Bug in Zope2.6.1b1
No one else has reported anything like this.
- Bug in Zope2.6.1b1 ZCatalog's backward compatability (could be intentional by the zcorp people)
Definitely not.
cheers,
Chris
Peter Bengtsson wrote at 2003-1-8 01:26 +0000:
I have started testing my product in Zope 2.6.1b1 and notice an odd behaviour
My code looks something like this:
catalog = self.ICatalog # an instance of ZCatalog called ICatalog I have
results1 = catalog() print results1 # returns 25 as expected
results2 = catalog({'email':'peter'})
# ...in Zope 2.5.0 print len(results2) # returns 2 as expected
# ...in Zope 2.6.1b1 print len(results2) # returns 25, i.e. as if the 'email' index is ignored!!! Are you sure, "email" is still an index? It seems as it were no longer recognized as index.
Dieter
At 23:17 2003-01-09 +0100, Dieter Maurer wrote:
Peter Bengtsson wrote at 2003-1-8 01:26 +0000:
I have started testing my product in Zope 2.6.1b1 and notice an odd behaviour
My code looks something like this:
catalog = self.ICatalog # an instance of ZCatalog called ICatalog I have
results1 = catalog() print results1 # returns 25 as expected
results2 = catalog({'email':'peter'})
# ...in Zope 2.5.0 print len(results2) # returns 2 as expected
# ...in Zope 2.6.1b1 print len(results2) # returns 25, i.e. as if the 'email' index is ignored!!! Are you sure, "email" is still an index? It seems as it were no longer recognized as index.
Yes I'm sure it's an index. I have several TextIndex indices in the Catalog and they all seem to have indexed something.
Dieter
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
participants (3)
-
Chris Withers -
Dieter Maurer -
Peter Bengtsson