[Zope-CMF] Portal Search Returns Everything + DeletedDocumentstoo
Chris Withers
chrisw@nipltd.com
Sun, 14 Jul 2002 10:15:30 +0100
Tres Seaver wrote:
>
> On Sat, 2002-07-13 at 07:58, Chris Withers wrote:
> > Dieter Maurer wrote:
> > >
> > > When I do not specify any restrictions, I expect to get everything...
> >
> > Dieter, you are exceptional ;-)
>
> While I would be the last person on this list to take issue with the
> plain sense of that statement, I would also agree with Dieter. Consider
> the following SQL:
>
> SELECT * FROM Foo;
>
> I would be *very* annoyed if that gave me back anything other than
> every row of the table, simply because I supplied no 'WHERE' clause.
Good point :-)
> The point of this issue is that the choice "no criteria implies no
> results" is a policy choice, which is easily implemented on any site via
> skins.
>
> E.g., customize the 'doFormSearch' PythonScript, found in the 'generic'
> skin folder. Modify its last line from::
>
> return context.portal_catalog( form_vars )
>
> to::
>
> return form_vars and context.portal_catalog( form_vars ) or ()
Would anyone object if I made doFormSearch like this by default?
> The default policy, in addition to being consistent with search
> retrieval semantics of other paradigns like SQL, would be *much* harder
> to implement via skins if your preference was the default in ZCatalog.
Another good point :-)
cheers,
Chris