[Zope-CMF] Modifying SearchableText...? How...?

Stoons - [ HeadNet ] stoons@headnet.dk
Fri, 20 Sep 2002 00:18:38 +0200


Hi....

I am trying to make a new Type based on "Portal Image"....
It is no problem to make the new type, with the interface and stuff, but:
How do I make all the Properties I add searchable...?

Here is a brief description on the new type:

Let us call the type "SearcMyProperties"
It is based on an "Image" (Portal Image) , but it has some ekstra
properties: "Dimbly:string" and "Doo:text"

How do I include "Dimbly" and "Doo" in the Search..?
I know that (my own) SearchableText should be a Script something like this:
=======
result=""
for a in range(len(context.propertyValues())):
    result="%s %s " % (result,str(context.propertyValues()[a]))
return "%s" % result
======

But how do I do this? - How do I "overwrite" the standard SearchableText...?

I have allready tried this:
1) I added the script above with the name "SearchableText"
2) I added the script above with the name "my_own_SearchableText", added
"my_own_SearchableText" to portal_catalog.metadata and added
"my_own_SearchableText" as a textindex to portal_catalog.indexes

None of the above made "Dimbly" or "Doo" searchable...

I know (or rather : think) that I could just include "Dimbly" and "Doo" in
portal_catalog.metadata / portal_catalog.indexes, but this is not what I am
looking for (I am trying to make an easier way of adding new Types... You
will hear more when I am done researching = ) )



Hoping somebody has the answer....
/ Stoons = )