ZCatalog FieldIndex bug in Zope 2.3.0b3
Hi, FieldIndex's don't work quite right in 2.3. Try this: - create a Catalog with a FieldIndex called 'test' - create a DTML document with a property 'test', value 'fish' - catalog the document - now change the value of the property to 'finger' and re-catalog. If you now search for test='finger' it'll return the document. However, if you search for test='fish', it will also return the document, which is wrong. cheers, Chris PS: Tabular reporting ZSearch Interfaces generated from Catalogs have quite badly b0rKen results forms, in that, for some reason, the search form ends up in a column of the results table, very confusing...
PS: Tabular reporting ZSearch Interfaces generated from Catalogs have quite badly b0rKen results forms, in that, for some reason, the search form ends up in a column of the results table, very confusing...
Huh? I cannot reproduce this at all (or even see how it could happen, looking at the tabular report dtml, which is pretty straightforward). You are seeing this on b3 with a totally freshly generated ZSearch interface that you have not altered (and looking at the generated dtml directly, not through a site-specific page that includes it)? Brian Lloyd brian@digicool.com Software Engineer 540.371.6909 Digital Creations http://www.digicool.com
Brian Lloyd wrote:
PS: Tabular reporting ZSearch Interfaces generated from Catalogs have quite badly b0rKen results forms, in that, for some reason, the search form ends up in a column of the results table, very confusing...
Huh? I cannot reproduce this at all (or even see how it could happen, looking at the tabular report dtml, which is pretty straightforward).
Okay, tracked down what's happening, can't understand why :-( Right, one of the metadata columns has the same name as the DTML method which shows the search form 'TestCase' in this situation. For some reason, the DTML method is being rendered instead of the meta data. I have no idea why, but I'll take a look... cheers, Chris
Chris Withers wrote:
Okay, tracked down what's happening, can't understand why :-(
Some data points before I rush off... - ZDebug doesn't like 2.3 very much :-S - Python Scripts rock ;-) However, from what ZDebug did show, it seems that the object the catalog has found ends up on the top of the namespace stack. Because this is a DTML method, I'm guessing the DTML method TestCase is acquired from it, before the namespace is searched for the meta_data, which is a little screwy :-( As to why the object is on the top of the namespace, I dunno whether it's dtml-in or ZCatalog that's responsible... cheers, Chris
On 1/26/01 11:56 AM, "Chris Withers" <chrisw@nipltd.com> wrote:
Chris Withers wrote:
Okay, tracked down what's happening, can't understand why :-(
Some data points before I rush off...
- ZDebug doesn't like 2.3 very much :-S - Python Scripts rock ;-)
However, from what ZDebug did show, it seems that the object the catalog has found ends up on the top of the namespace stack. Because this is a DTML method, I'm guessing the DTML method TestCase is acquired from it, before the namespace is searched for the meta_data, which is a little screwy :-(
As to why the object is on the top of the namespace, I dunno whether it's dtml-in or ZCatalog that's responsible...
Odd, I thought you were reffering to another bug that I fixed, thanks to your report :-) hehehe, apparantly that wasn't the actual bug you were interested in.... Should I put the other one back? :-) Chris -- | Christopher Petrilli | petrilli@digicool.com
I'm guessing the DTML method TestCase is acquired from it, before the namespace is searched for the meta_data, which is a little screwy :-(
Odd, I thought you were reffering to another bug that I fixed, thanks to your report :-) hehehe, apparantly that wasn't the actual bug you were interested in.... Should I put the other one back? :-)
Other one? not sure what you mean there... The bug with FieldIndexes was the most important, one of our VIP(roject)s crucially relies on this ;-) The ZSearch problem is weird. I'd need to fix ZDebug to work with 2.3 first though as, AFAIK, a normal TemplateDict won't tell you what mappings/InstanceDicts it has in it and what order they're in :-S Thanks for the quick fix though :-) Chris
Chris Withers wrote:
Okay, tracked down what's happening, can't understand why :-(
Now I can... convoluted but with a simple answer ;-)
As to why the object is on the top of the namespace, I dunno whether it's dtml-in or ZCatalog that's responsible...
The reason for this, was because the object was being acquired. The naming similarity was pure chance. I had an index called TestCase in the catalog, the same name as the DTML method for the form. I _didn't_ have a column called TestCase in the ZCatalog MetaData, so when the result-displaying DTML method tried to dtml-var it, it was acquired, and hence the method was plopped on top of the namespace. The actual problem is that ZCatalog was using the indexes instead of the metadata when telling Z Search was results form to build. The following patch solves that, I'm sure I put it in the collector when I moved Squishdot to use ZCatalog too :-S cheers, Chris --- zcatalog.py.old2 Sun Jan 28 20:56:06 2001 +++ zcatalog.py Sun Jan 28 21:00:09 2001 @@ -486,7 +486,7 @@ def _searchable_result_columns(self): r = [] - for name in self._catalog.indexes.keys(): + for name in self._catalog.schema.keys(): i = {} i['name'] = name i['type'] = 's' PS: I won't bother with the collector on this one, since both relevent people are already being CC'ed ;-)
I've put the fieldindex bug in the collector. ----- Original Message ----- From: "Chris Withers" <chrisw@nipltd.com> To: <zope-dev@zope.org>; <petrilli@digicool.com> Sent: Friday, January 26, 2001 10:38 AM Subject: [Zope-dev] ZCatalog FieldIndex bug in Zope 2.3.0b3
Hi,
FieldIndex's don't work quite right in 2.3.
Try this: - create a Catalog with a FieldIndex called 'test' - create a DTML document with a property 'test', value 'fish' - catalog the document - now change the value of the property to 'finger' and re-catalog.
If you now search for test='finger' it'll return the document. However, if you search for test='fish', it will also return the document, which is wrong.
cheers,
Chris
PS: Tabular reporting ZSearch Interfaces generated from Catalogs have quite badly b0rKen results forms, in that, for some reason, the search form ends up in a column of the results table, very confusing...
_______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org 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 )
On 1/26/01 11:41 AM, "Chris McDonough" <chrism@digicool.com> wrote:
I've put the fieldindex bug in the collector.
This is now fixed... It was a bizarre logic problem, but I could reproduce it easily :-) Thanks for finding this. Chris -- | Christopher Petrilli | petrilli@digicool.com
participants (4)
-
Brian Lloyd -
Chris McDonough -
Chris Withers -
Christopher Petrilli