Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8010175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:39:40+00:00 2026-06-04T18:39:40+00:00

I am currently using Act_as_taggable_on for tagging and pg_search to search through my postgresql

  • 0

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 Post by saying “Post.find(1).tag_list,” but there are no “tag” columns in the Post table, so when I run the

 pg_search_scope :search_by_weight, :against => {:tag_list => 'A', :title => 'B', :content => 'C'} #,:using => [:tsearch => {:prefix => true}] #:trigram, :dmetaphone]

it gives me an error because the column Post.tag_list doesn’t exist in the Post table. What is it called when you can find the value through the dot connector (i.e. mission.tag_list) but when it doesn’t exist in the table? I didn’t know what to type. So basically, how do I pass in a non-existent column as a params?

Also, you may have noticed I commented out the

 :using => [:tsearch => {:prefix => true}] #:trigram, :dmetaphone]

above. I can’t seem to find how to install extra modules for Postgresql. Where do I type CREATE EXTENSION? (using ubuntu 11.10 and postgresql 9.1.3 -> and heroku for production)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T18:39:41+00:00Added an answer on June 4, 2026 at 6:39 pm

    A much more simple approach is just using the association and search that through pg_search which is done like this:

    class Item < ActiveRecord::Base
     include PgSearch  
    
      pg_search_scope :full_search, 
        :against => {  
        :item_status => 'A',
        :title => 'B',
        :description => 'C'    
       },       
        :associated_against => {
        :tags => [:name]    
       }
    end 
    

    I just implemented this in one of my projects and it worked well (searched through tag names). Unfortunately I can’t figure out how to weight an associated relationship since it says “tags” column not found in Items table.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a simple project tagging application using the Act_As_Taggable_On gem. Adding projects, and
Currently using a MySQL database Wanting to insert a new row into a table
I'm currently using a WebBrowser control in a C# WinForms application, and attempting to
I'm developing a windows forms application using VB.NET. I'm currently working on DataReport (by
I have a WPF application which uses a (currently) local database to act as
Currently using Chrome v19.0.1084.46 (Official Build 135956) beta-m jqGrid 4.3.2 (latest release) The problem
Currently using the HTTPServletRequest class and specifically the .getQueryString method to retrieve an inputted
Currently using Google Analytics as a supplement to our paid tracking software, but neither
Currently using MySQL version 5.1.6 This is my first real world build and so
Currently using Xcode 4.2 and I have two view controllers (1 and 2). I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.