We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
With a Rails 4 app, I've added a single column to multisearch, and get a syntax error from Postgres 9.1 when calling count on the results:
irb(main):017:0> PgSearch.multisearch("olvidar").count (0.7ms) SELECT COUNT("pg_search_documents".*, ((ts_rank((to_tsvector('simple', coalesce("pg_search_documents"."content"::text, ''))), (to_tsquery('simple', ''' ' || 'olvidar' || ' ''')), 0))) AS pg_search_rank) FROM "pg_search_documents" WHERE (((to_tsvector('simple', coalesce("pg_search_documents"."content"::text, ''))) @@ (to_tsquery('simple', ''' ' || 'olvidar' || ' ''')))) PG::Error: ERROR: syntax error at or near "AS" LINE 1: ...ery('simple', ''' ' || 'olvidar' || ' ''')), 0))) AS pg_sear... ^ : SELECT COUNT("pg_search_documents".*, ((ts_rank((to_tsvector('simple', coalesce("pg_search_documents"."content"::text, ''))), (to_tsquery('simple', ''' ' || 'olvidar' || ' ''')), 0))) AS pg_search_rank) FROM "pg_search_documents" WHERE (((to_tsvector('simple', coalesce("pg_search_documents"."content"::text, ''))) @@ (to_tsquery('simple', ''' ' || 'olvidar' || ' ''')))) ActiveRecord::StatementInvalid: PG::Error: ERROR: syntax error at or near "AS"
The text was updated successfully, but these errors were encountered:
Are you using rails 4-0-stable? I ran into this same issue while using stable, but not with 4.0.0. I believe the reason is in here: rails/rails#10710
You should be able to fix the problem by using count(:all) rather than just count.
Sorry, something went wrong.
Yep, that was the reason.
No branches or pull requests
With a Rails 4 app, I've added a single column to multisearch, and get a syntax error from Postgres 9.1 when calling count on the results:
The text was updated successfully, but these errors were encountered: