On Wed, 21 Mar 2001, Tres Seaver wrote:
Given that any site manager can override the policy trivially, using only two lines of DTML, should we really be switching the (admittedly arbitrary) existing polciy embedded in the core? [... <dtml-let search_terms="_.string.split( search_text )" search_with_and="_.string.join( search_terms, ' and ' )"> <dtml-var searchCatalog> </dtml-let>
OK, so it is two and a half lines.
Well, actually it's a *lot* more than that, unless you have both a regular search and an 'advanced search' box. Consider what happens if the user enters the following search string: foo or bar The code above produces the search "foo and or and bar". I'm actally not sure what Catalog will do with that, but I doubt it is what the searcher intended. Even if you have regular and advanced search boxes, having the default operator in one be the opposite of the default operator in the other would be a bad thing from a user interface design standpoint, IMO. Making the default operator settable strikes me as simpler/better design than writing a method that will do the transformation correctly, since the latter basically requries duplicating the top level of the text index search input parser. --RDM