Forum OpenACS Q&A: Openacs.org - bug in homepage search

Collapse
Posted by Niall Burke on
FYI,

I just noticed that if you type the word "NOT" into the search and hit return a database error is dumped i.e.

Database operation "select" failed (exception NSDB, "Query was not a statement returning rows.")

ERROR: no operand

SQL: select o.object_id
from txt, acs_objects o
where fti @@ to_tsquery('default','!')
and o.object_id = txt.object_id
and exists (select 1
from acs_object_party_privilege_map m
where m.object_id = txt.object_id
and m.party_id = '144049'
and m.privilege = 'read')
order by rank(fti,to_tsquery('default','!')) desc
limit 10 offset 0
while executing
"ns_pg_bind select nsdb0 {select o.object_id
from txt, acs_objects o
where fti @@ to_tsquery('default',:query)

Collapse
Posted by Dave Bauer on
Thanks for that report. Apparently you typed "not" without any other search terms.

You can use "AND" "OR" and "NOT" in your search to refine the results, but it looks like the parser for the search driver doesn't handle "not" all by itself.