On 8/8/07, Tom Lane <tgl@xxxxxxxxxxxxx> wrote: > Oleg Bartunov <oleg@xxxxxxxxxx> writes: > > On Wed, 8 Aug 2007, cluster wrote: > >> Does anyone know where I can request an OR-version of plainto_tsquery()? > > > plainto_tsquery expects plain text, use to_tsquery for boolean operators. > > Are either of these definitions really right? If I type "foo bar baz" > into Google, for instance, it seems to produce some sort of weighted > result, neither a strict AND nor a strict OR. Google didn't get where > they are by misjudging what the simplest search behavior should be like. As far as I'm aware Google is normally AND -- the catch is that it doesn't always use keywords from the page itself. Sometimes it'll look for search terms that appear in pages that link to the returned one; the cached version will notify you of this in the header. Ranking seems to make words weighted by order and proximity, but of course Google's full ranking behavior is another matter... http://www.google.com/intl/en/help/basics.html#and http://www.google.com/help/cheatsheet.html For me personally, I expect to need a search interface that accepts "AND", "OR", and "NOT" as boolean op words, and possibly parenthetical grouping (IOW, everything to_tsquery supports in plain english form), with freeform words defaulting to AND. Is this the same thing most people need? I doubt it. ---------------------------(end of broadcast)--------------------------- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match