[Sqlalchemy-tickets] Issue #3078: postgresql full-text search on `match` should accept multiple par
Brought to you by:
zzzeek
|
From: jvanasco <iss...@bi...> - 2014-06-10 15:55:57
|
New issue 3078: postgresql full-text search on `match` should accept multiple parameters https://bitbucket.org/zzzeek/sqlalchemy/issue/3078/postgresql-full-text-search-on-match jvanasco: I wanted to note a deficiency in the support for full-text search. the various tsvector and tsquery commands accept 1 or 2 arguments ( string ) ( dictionary_type, string ) as in - http://www.postgresql.org/docs/9.1/static/functions-textsearch.html while it possible to explicitly search with a to_tsvector()/to_tesquery that accepts a configuration argument ( as in https://bitbucket.org/zzzeek/sqlalchemy/issue/2800/unable-to-create-tsvector-functional-index ), it is not possible to sneak this parameter into the `match` command. ie: search_query = 'dogs & cats' sqlalchemy.func.to_tsquery( text("'english'"), MyTable.mycolumn )\ .match( sqlalchemy.text("'english'"), search_query ) the target sql would be: to_tsvector('english', mytable.mycolumn) @@ to_tsquery('english', 'dogs & cats') The effects of this behavior: - loss of control in how the actual matching occurs - vectors may need to be computed in real-time, rendering indexes or precomputed values useless. |