[Zope] What is PrincipiaSearchSource et al?

Max M maxm@mxm.dk
Mon, 23 Sep 2002 14:01:54 +0200


Felix Ulrich-Oltean wrote:

> What is the Principia* stuff all about?  I've seen it dotted around
> the Zope code and I'm curious.


if you have a "PrincipiaSearchSource" attribute defined in an object, 
the catalog will use it for a full text search index.


If it is callable the catalog will automatically call it.

typcally in a product it will look like:

def PrincipiaSearchSource(self):
     "Returns full text of object"
     return ' '.join(self.title, self.summary, self.content, self.author)


> Also, I'm building a Zope product and wondering if I have to worry
> about defining a PrincipiaSearchSource method or anything else, as
> I've seen it mentioned in the same breath as ZCatalog a few times.


Use it if you want full text search index, it is defined by default by 
the catalog as an index.

You can also delete it from the catalog an use your own index and call 
it something more sensible like "full_text_source" or whatever.

The Principia* is a leftover from an older version of Zope that was 
called "Principia" :-/



regards Max M


---

the Law of Inverse Squares. With sound, for example, a source twice as
far away from the detector (an ear?) provides just one-quarter of the
strength of signal. ESP has been said to show no fall-off at all, let
alone any diminution of strength. Well, we must admit that zero signal
won't show any change...