Questions tagged [pg-search]

Ruby gem that builds ActiveRecord named scopes that take advantage of PostgreSQL's full text search.

pg_search builds ActiveRecord named scopes that take advantage of PostgreSQL's full text search.

203 questions
0
votes
1 answer

How can I sort or order a full text search with multiple (ASC and DESC) fields in Rails?

I've learned that I cannot do a join and then an order in ActiveRecord. This appears to also apply to pg_search's full_text_search method. This, for example, does not apply the ordering I…
Alien Life Form
  • 581
  • 1
  • 7
  • 15
0
votes
1 answer

Chaining multiple queries in Rails

I'd like to chain multiple queries together that are on different models is this possible? Example: I have Restaurants that have many Dishes. I want to search for restaurants that are close to a location and then search for the dishes those…
babaloo
  • 435
  • 5
  • 24
0
votes
1 answer

Rails: Pg search, implementing dmetaphone with associated_against feature

after I created the : rails g pg_search:migration:dmetaphone I got this error: Adding support functions for pg_search :dmetaphone -- execute("CREATE OR REPLACE FUNCTION pg_search_dmetaphone(text) RETURNS text LANGUAGE SQL IMMUTABLE STRICT AS…
0bserver07
  • 3,390
  • 1
  • 28
  • 56
0
votes
1 answer

Rails 4 pg_search - multisearchable Issue

I'm using the pg_search gem for Rails (Ruby 2.1.1, Rails 4.1.4) and trying to implement a global multisearch for some of my models but I keep getting PG::UndefinedFunction: ERROR: operator does not exist: text % unknown when I run the multisearch…
user3029619
  • 109
  • 1
  • 10
0
votes
1 answer

PG_Search rendering more data than I want to in results?

I'm using pg_search to do some basic search in my Rails app, but when I try and render certain things like the name attribute of each result, it also renders a pg_search hash of all the data for that result. Here's my search results page code:
Tom Maxwell
  • 9,273
  • 17
  • 55
  • 68
0
votes
1 answer

How to use pg_search in a multi-lingual website?

If I understand the pg_search documentation well, there is only one table storing "searchable" documents for the entire website, so my question is: Is there any way, other than filtering the search results by language, that allows to do a…
0
votes
0 answers

Squeel query cannot be chained with pg_search query in Ruby on Rails

I would like to execute the following code to perform a search in my controller: experts_controller.erb @users = User.text_search(params[:query]).has_skill_categories(params[:skills]).has_marketing_assets(params[:marketing_platforms]) When I run…
miggitty
  • 47
  • 2
  • 9
0
votes
1 answer

pg_search and multi column indexing (Rails 4)

I have a full-text search query in PostgreSQL that looks like this: to_tsvector('english', coalesce("products"."name"::text, '')) || to_tsvector('english', coalesce("products"."uid"::text, '')) || to_tsvector('english',…
0
votes
1 answer

How to perform a search using pg search gem for a field that is assoicatied through another table?

I have a table called user and I just created a tagging system, where users can have tags through another table. Same way this rail cast does it for it's Books and Authors. Now I have a search already which is based this way: def…
0bserver07
  • 3,390
  • 1
  • 28
  • 56
0
votes
1 answer

Modeling Choices from Static List of Values

I have a model which may be associated with zero or more static values. For example, movies and genres (horror, action, etc.) I want to make an genres array on my model but I'm not sure the best way to reflect this in the database. I am using…
Drew
  • 15,158
  • 17
  • 68
  • 77
0
votes
0 answers

pg_search with modified content

Does anyone know how to modify columns content before pg_search stores it? Full explanation: I have model Article with columns title and body. In body I store article's body html. PgSearch is configured with multisearchable against: [:title,…
tomazzlender
  • 1,123
  • 12
  • 22
0
votes
1 answer

SQLite3::SQLException: unrecognized token: ":":

I'm having trouble running pg_search. I think it's set up correctly, but for some reason when trying to run a search, this comes up: SQLite3::SQLException: unrecognized token: ":": SELECT "courses".*,…
John
  • 31
  • 2
  • 5
0
votes
2 answers

How can I set a session variable from inside a monkeypath on String

I'm getting the following error... pry("serp")> session[self.to_sym] = "closed" NameError: undefined local variable or method `session' for "serp":String ...when I try to set a session variable from within a monkeypatch on the String class.…
steven_noble
  • 4,133
  • 10
  • 44
  • 77
0
votes
1 answer

Why am I getting an infinite loop with pg_search?

When I point my browser at http://localhost:3000/searches, I get the following error: Error 324 (net::ERR_EMPTY_RESPONSE): The server closed the connection without sending any data. Why? And how do I fix this? Relevant code…
steven_noble
  • 4,133
  • 10
  • 44
  • 77
0
votes
1 answer

How Do I Use Joins for Three Tables in Ruby on Rails?

I am working on a Ruby on Rails application which already has logic for text searching using pg_search and two other fields on a model. The logic creates an 'array' of rows from the search result. I do not remember the actual name of this since…
1 2 3
13
14