Re: [Zope-dev] ZCatalog Brains
On Wed, 23 May 2001, Chris Withers wrote: > Hi, > > Is it still fair game to use the data_record_normalized_score_ attibute of > ZCatalog Brain objects? Yes. > If so, is it accurate and meaningful? Only for queries involving text indexes, and even then it's not very meaningful. It takes the entire batch of search results, from the most relevant (word occourance score) the the least relevent, and normalizes all their scores between 0 and 100 (or 0 and 1, same difference). > Finally, is there any way I can do the Google-esque thing of showing the snippet > of the searched etxt with the words that were found highlighted? Yes, You would have to fetch the object and then scan it for the search terms. -Michel ___ 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] ZCatalog Brains
Hi, Is it still fair game to use the data_record_normalized_score_ attibute of ZCatalog Brain objects? If so, is it accurate and meaningful? Finally, is there any way I can do the Google-esque thing of showing the snippet of the searched etxt with the words that were found highlighted? cheers, Chris ___ 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] ZCatalog brains
Steve Alexander wrote: > Although there are ways to do this now, I guess I was wondering about > making it a standard part of catalogs. I'm sure code will be greatfully recieved ;-) > Thinking further though, if it is as easy as adding "url" to the > catalog's metadata, why bother? Hmm, how about (for Zope 2.2 anyway) just adding a metadata column called getPhysicalPath? As long as your catalogued items support the traversal interface, this should work fine :-) cheers, Chris ___ 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] ZCatalog brains
Chris Withers wrote: > > Steve Alexander wrote: > > Is there any good reason that the "brains" returned by ZCatalog searches > > don't have a standard property that reflects the URL of the object they > > have meta-data from? > > That sounds like a good idea :-) > > > This would seem to me to be more object-oriented, and would save calls > > to someCatalog.getpath(data_record_id_) in loops. > > All you'd need to do is find some way of returning this from a method of > your object-being-catalogued that takes no arguments and then you could > add it as normal meta-data column. > > I wonder if that's possible? Yes. The url method of CatalogAwareness does this. So you could just add "url" to the metadata of your catalog. > cheers, > > Chris > > PS: You could always just make your own brains that returned the results > of this call, but that doesn't make it any more efficient :( It makes it less efficient, as the object would have to be obtained when you made the brain.url call. Not much point using brains at all then. Although there are ways to do this now, I guess I was wondering about making it a standard part of catalogs. Thinking further though, if it is as easy as adding "url" to the catalog's metadata, why bother? -- Steve Alexander Software Engineer Cat-Box limited http://www.cat-box.net ___ 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] ZCatalog brains
Steve Alexander wrote: > Is there any good reason that the "brains" returned by ZCatalog searches > don't have a standard property that reflects the URL of the object they > have meta-data from? That sounds like a good idea :-) > This would seem to me to be more object-oriented, and would save calls > to someCatalog.getpath(data_record_id_) in loops. All you'd need to do is find some way of returning this from a method of your object-being-catalogued that takes no arguments and then you could add it as normal meta-data column. I wonder if that's possible? cheers, Chris PS: You could always just make your own brains that returned the results of this call, but that doesn't make it any more efficient :( ___ 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] ZCatalog brains
Is there any good reason that the "brains" returned by ZCatalog searches don't have a standard property that reflects the URL of the object they have meta-data from? This would seem to me to be more object-oriented, and would save calls to someCatalog.getpath(data_record_id_) in loops. Am I missing something? -- Steve Alexander Software Engineer Cat-Box limited http://www.cat-box.net ___ 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 )