Forum OpenACS Q&A: Issues with tsearch - ring any bells?

I'm trying to fix search on a site with PostgreSQL 7.3.4 and tsearch (1, not 2). Much as I'd like to blow it away and start over, there's client data in it, so I'd rather fix it, if possible.

Here's the error that results from searching on 'hephalump':

ERROR: Attribute "pos" not found

SQL:
select txt.tid as object_id
from txt
where

txt.fts_index @@ '\'hephalump\''

order by pos desc
limit 10
offset 0
while executing
"ns_pg_bind select nsdb0 {
select txt.tid as object_id
from txt
where

txt.fts_index @@ '\'hephalump\'..."
("uplevel" body line 1)
invoked from within
"uplevel $ulevel [list ns_pg_bind $type $db $sql]"
("postgresql" arm line 2)
invoked from within
[SNIP]

I see things getting indexed, so that part seems to be working. The 'txt' table looks like:

tid | path | fts_index | last_modified
------+------+---------------------------------------------------------------------------------------------------------------+----------------------------
2688 | | 'see' 'hope' 'post' 'test' 'check' 'eleph' 'final' 'known' 'search' 'sincer' 'respons' 'function' 'hephalump' | 2005-03-28 13:07:45.153932
(1 row)

So there's no 'pos' column in this table. I can't figure out where the query that's trying to order by 'pos' exists, despite extensive grepping. Any suggestions? Can someone tell me where this sql code is lurking?

Collapse
Posted by Dave Bauer on
Look in the OpenFTS source code. That is where it actually builds the query. I haven't seen this before.

What version of OpenACS are you using?

Collapse
Posted by Cathy Sarisky on
Why is it that I can never solve my problems until I post, and then it becomes abundantly clear.

Several hour ago, while trying to get tsearch to work with 0.3.1, I'd followed the suggestion in this thread: https://openacs.org/forums/message-view?message%5fid=68129 , which resulted in the breakage reported above. Doh. Reverting my changes resolves the problem in 0.3.2.