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
12
votes
3 answers

Word separators for Postgres full text search with Rails

I'm using pg_search for some text searching within my model. Among other attributes, I have an url field. Unfortuantelly Postgres doesn't seem to identify / and . as word separators, therefore I cannot search within the url. Example: searching for…
mihai
  • 37,072
  • 9
  • 60
  • 86
11
votes
1 answer

PostgreSQL: How to go around ts_vector size limitations?

I'm creating a search inside a Rails app using the pg_search gem. However, one of the tables have a Text datatype field that it's content happens to be a little larger than usual. Now when I need to setup a tsvector column for the text columns, I…
0bserver07
  • 3,390
  • 1
  • 28
  • 56
11
votes
1 answer

How to remove ranking of query results

I have the following pg_search scope on my stories.rb model: pg_search_scope :with_text, :against => :title, :using => { :tsearch => { :dictionary => "english" }}, :associated_against…
chuck w
  • 1,741
  • 2
  • 15
  • 34
10
votes
1 answer

How can ransack use pg_search?

I'd like to use ransack (via ActiveAdmin) to do full-text searches on a model. How can I get ransack to use pg_search for its query? I want to run queries that, among other query components, use pg_search functionality.
Eric
  • 5,815
  • 3
  • 25
  • 34
10
votes
1 answer

How do I implement advanced search with operators with pg_search?

I have implemented PgSearch on my Node model like so: include PgSearch pg_search_scope :node_search, against: [:name, :user_id, :circa], using: { tsearch: { any_word: true} }, :associated_against => { comments: [:message], user:…
marcamillion
  • 32,933
  • 55
  • 189
  • 380
10
votes
1 answer

Proper full text index Rails/PostgreSQL/pg_search

I am testing performance for PostgreSQL full text search (using pg_search gem) and solr (sunspot_solr gem). For 4 million records I am getting 13456 ms for Tsearch and 800 ms with SOLR (that is SOLR query + DB retrival). It is obvious that I need…
Haris Krajina
  • 14,824
  • 12
  • 64
  • 81
10
votes
2 answers

What does "text-search query doesn't contain lexemes:" mean?

In a Rails app I'm using the pg_search gem. When I run my RSpec suite I see many lines of: NOTICE: text-search query doesn't contain lexemes: "" LINE 1: ...e("pg_search_documents"."content"::text, '')))), (''), 0)) A... I'm not sure what this…
Andy Harvey
  • 12,333
  • 17
  • 93
  • 185
10
votes
3 answers

Rails: How do I search tags generated by Act_As_Taggable_On with PG_Search? (postgresql)

I am currently using Act_as_taggable_on for tagging and pg_search to search through my postgresql database on my Rails 3 application. How would I search through tags generated by the act_as_taggable_on gem with pg_search? I can view the tags of a…
kibaekr
  • 1,319
  • 1
  • 21
  • 38
9
votes
4 answers

Text Search for Rails 3 on Heroku - Texticle vs acts_as_tsearch vs acts_as_indexed

I am building a Rails 3 application that will be hosted on Heroku. To implement full text search, these are the free alternatives that I have come across: Texticle acts_as_tsearch acts_as_indexed My application is going to be data intensive with a…
Nirav Shah
  • 689
  • 6
  • 16
9
votes
1 answer

Can't run rake db:migrate a tsvector GIN index for Postgresql in Rails using Railscast sample

I'm following along on Ryan Bates' excellent tutorial on using the built-in PostgresQL full-text search in Rails. I'm currently using pg_search gem un-indexed no problem but I need to improve the performance. I am using tsvector with "english"…
Paul
  • 2,021
  • 5
  • 22
  • 33
8
votes
1 answer

Substring search with pg_search

I'm using pg_search to search for Products: class Product include PgSearch pg_search_scope( :search_for, against: %i(sku), associated_against: { translations: [:name, :description] }, using: { tsearch: { prefix: true } } …
csch
  • 4,496
  • 2
  • 19
  • 23
8
votes
8 answers

Are there other search options for heroku

I am about to launch a beta site, and heroku looks like a great option. The only think that is getting me down is that the only search option is $20/mth for the Websolr add-on. I am sure that Websolr is great, but at this very early point in this…
Jonathan
  • 16,077
  • 12
  • 67
  • 106
8
votes
1 answer

How to configure a pg_search multisearch on associated models in Rails?

I'm adding pg_search into a Rails app. I'm not completely understanding the configuration, and would appreciate a gentle nudge in the right direction. First, I already have a multi model site more or less set up and running on my app. But I want to…
Andy Harvey
  • 12,333
  • 17
  • 93
  • 185
7
votes
3 answers

How to include Pgsearch in Action Text in Rails

I'm adding pgsearch to Rails 6 Action Text and am not sure the best technique for including pgsearch in the RichText model. I can't seem to monkey patch the model without breaking it. I do have it working by replacing the model entirely, but…
pzupan
  • 169
  • 1
  • 7
7
votes
2 answers

pg_search: ordering of "multisearchable" results

I'm using Rails 4.2.4 with pg_search 1.0.5. class Advert < ActiveRecord::Base include PgSearch multisearchable :against => [:title, :body] end I would like to order the pg_search results by the :created_at date of my Advert records.…
garbo999
  • 383
  • 2
  • 12
1
2 3
13 14