Casecommons/pg_search — Issue #28: pg_search_scope need alias for avoid ambiguity
Author: daniel2d2art
Created: 2012-03-02 14:29:26+00:00
State: open

Hi here,

When using pg_search on join query, in cases where several tables has same fields names, we've the problem of ambiguous field name. There is some way to specify the Alias or the table name to pg_search_scope query?.

I'm using a {:tsvector_column => 'fts_vector'}, and workaround setting it like {:tsvector_column => 'my_table.fts_vector'}. This converts query results .... (fst_vector) @@ (to_tsquery( ...
to some thing like ...(my_table.fst_vector) @@ (to_tsquery( ...
But I don't know if will be problematic for future pgsearch versions. It will be?

I don't know if actually exist a way, but perhaps some configuration option about table alias, or adding table_name on :tsvector_column operation mode, or passing alias as argument together the query when call the scope .... ... ...

Thx!