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

Stoons - [ HeadNet ] stoons@headnet.dk
Wed, 25 Sep 2002 09:27:31 +0200


Btw: I am running CMF 1.3 on zope2.51... This might be relevant info... = )

/Stoons

----- Original Message -----
From: "Stoons - [ HeadNet ]" <stoons@headnet.dk>
To: <zope-cmf@zope.org>
Cc: "Dieter Maurer" <dieter@handshake.de>
Sent: Tuesday, September 24, 2002 11:47 PM
Subject: Re: [Zope-CMF] Modifying SearchableText...? How...?


> I modified the doFormSearch instead:
> =============
> vars = REQUEST.form
> form_vars = {}
> skip_vars = []
> select_vars = ( 'review_state'
>               , 'Subject'
>               , 'portal_type'
>               )
> date_vars = ('created',
>              )
> epoch = DateTime("1970/01/01 00:00:00 GMT")
>
> for k, v in vars.items():
>
>     if k in select_vars:
>         if same_type( v, [] ):
>             v = filter( None, v )
>         if not v:
>             continue
>
>     if k in date_vars:
>         if v == epoch and vars.get(k+'_usage') == 'range:min':
>             skip_vars.append(k+'_usage')
>             continue
>
>     form_vars[ k ] = v
>
> for k in skip_vars:
>     del form_vars[k]
>
> # the change starts here
> result=list(context.portal_catalog( form_vars ))
> for a in list(context.portal_catalog(
seekText=REQUEST['SearchableText'] )):
>   if a not in result:
>     result.append(a)
>
> return result
> ==============
>
> I did this because I wanted to include the standard search in the search
as
> well....
>
> It works perfectly now....
>
> /Stoons
>
>
> ----- Original Message -----
> From: "Dieter Maurer" <dieter@handshake.de>
> To: "Stoons - [ HeadNet ]" <stoons@headnet.dk>
> Cc: <zope-cmf@zope.org>
> Sent: Tuesday, September 24, 2002 9:50 PM
> Subject: Re: [Zope-CMF] Modifying SearchableText...? How...?
>
>
> > Stoons - [ HeadNet ] writes:
> >  > ...
> >  > I added a new script to "custom" called "seekText" :
> >  > ...
> >  > but: When I search the content of "seekText" on the site it returns:
> None...
> > Because, the search term comes as "SearchableText" while it should come
> > as the new "seekText".
> >  > ...
> >  > I have already tested it, and it "works" when "search" looks like
this:
> >  > = = = = = = = = = = = = = = = = = =
> >  > <dtml-in "portal_catalog(seekText=REQUEST['SearchableText'])">
> > Modify the search form. Replace the form control name "SearchableText"
> > by "seekText".
> >
> >
> > Dieter
> >
> > _______________________________________________
> > Zope-CMF maillist  -  Zope-CMF@zope.org
> > http://lists.zope.org/mailman/listinfo/zope-cmf
> >
> > See http://collector.zope.org/CMF for bug reports and feature requests
> >
>
>
> _______________________________________________
> Zope-CMF maillist  -  Zope-CMF@zope.org
> http://lists.zope.org/mailman/listinfo/zope-cmf
>
> See http://collector.zope.org/CMF for bug reports and feature requests
>