Yet another Zcatalog question--PrincipiaSearchSource
Right now we've got our main Catalog storing only information about a Zclass, and it's only got one ZCTextindex--on PrincipiaSearchSource. I'd like people to be able to search the title AND the PrincipiaSearchSource at the same time--in other words, have both indexed. Is there a way to index both in the same ZCTextIndex so I don't have to keep two text indexes and combine searches into both? I'm thinking of trying to index some sort of method inside the Zclass that combines the two, but I can't seem to figure out what that method should look like--how do I say "concatenate title and data into a single piece of data that can be indexed"? And now to complicate things even more... Say I want to mix it up a bit and include pictures in my search. Our pictures have a property called Cutline that would need to be indexed. Could we trick the Catalog into also indexing Cutline in the same TextIndex? Or am I just talking crazy now? Thanks--Chris
--On Freitag, 14. März 2003 9:43 Uhr -0500 Chris Muldrow <cmuldrow@fredericksburg.com> wrote:
Right now we've got our main Catalog storing only information about a Zclass, and it's only got one ZCTextindex--on PrincipiaSearchSource. I'd like people to be able to search the title AND the PrincipiaSearchSource at the same time--in other words, have both indexed. Is there a way to index both in the same ZCTextIndex so I don't have to keep two text indexes and combine searches into both? I'm thinking of trying to index some sort of method inside the Zclass that combines the two, but I can't seem to figure out what that method should look like--how do I say "concatenate title and data into a single piece of data that can be indexed"?
I wrote a proposal to implement multi-attribute handling for indexes for Zope 2.7. This proposal is implemented and will appear with Zope 2.7. ZCTextIndex and TextIndexNG will support this new feature. TextIndexNG already supports multiple attributes with Zope 2.6. -aj
On Fri, Mar 14, 2003 at 09:43:43AM -0500, Chris Muldrow wrote:
Right now we've got our main Catalog storing only information about a Zclass, and it's only got one ZCTextindex--on PrincipiaSearchSource. I'd like people to be able to search the title AND the PrincipiaSearchSource at the same time
You could write a python method which is called PrincipiaSearchSource. This returns the combination of the original text and the title.
And now to complicate things even more... Say I want to mix it up a bit and include pictures in my search. Our pictures have a property called Cutline that would need to be indexed. Could we trick the Catalog into also indexing Cutline in the same TextIndex? Or am I just talking crazy now?
def PrincipiaSearchSource(self): return "%s %s %s" % (self.oldPrincipiaSearchSource, self.title, self.Cutline) BTW, according to the general style guide attributes should be written with lower case. (*C*utline) thomas -- Thomas Guettler <guettli@thomas-guettler.de> http://www.thomas-guettler.de
When I try this, it doesn't actually index the data for the search source--I've tried both PrincipiaSearchSource and document_src--but it does this: <bound method FLSNewsStory.document_src of <FLSNewsStory at /News/FLS/2003/032003/03172003/france>> France calls emergency U.N. meeting on Iraq's peaceful disarmament, ignoring U.S. deadline
def PrincipiaSearchSource(self): return "%s %s %s" % (self.oldPrincipiaSearchSource, self.title, self.Cutline)
BTW, according to the general style guide attributes should be written with lower case. (*C*utline)
thomas
-- Thomas Guettler <guettli@thomas-guettler.de> http://www.thomas-guettler.de
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
PrincipiaSearchSource is a callable method. Instead try: return "%s %s %s" % (self.PrincipiaSearchSource(), self.title, self.Cutline) hth, -Casey On Monday 17 March 2003 01:17 pm, Chris Muldrow wrote:
When I try this, it doesn't actually index the data for the search source--I've tried both PrincipiaSearchSource and document_src--but it does this: <bound method FLSNewsStory.document_src of <FLSNewsStory at /News/FLS/2003/032003/03172003/france>> France calls emergency U.N. meeting on Iraq's peaceful disarmament, ignoring U.S. deadline
def PrincipiaSearchSource(self): return "%s %s %s" % (self.oldPrincipiaSearchSource, self.title,
self.Cutline)
BTW, according to the general style guide attributes should be written with lower case. (*C*utline)
thomas
participants (5)
-
Andreas Jung -
Casey Duncan -
Chris Muldrow -
Chris Muldrow -
Thomas Guettler