[Zope-CMF] Portal Search Returns Everything + Deleted Documentstoo

Tres Seaver tseaver@zope.com
13 Jul 2002 11:38:28 -0400


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.

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 ()


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.

Tres.
-- 
===============================================================
Tres Seaver                                tseaver@zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com