SitePoint Sponsor

User Tag List

Results 1 to 1 of 1
  1. #1
    SitePoint Zealot
    Join Date
    Mar 2003
    0 Post(s)
    0 Thread(s)

    How to display search results using thinking sphinx

    I have thinking sphinx setup with my search form, but it is returning all users instead of users with the data I searched.

    In the users controller:

    Code Ruby:
    def index
    @users = params[:query].blank? ? User.all :[:query])

    user_index.rb (inside /indices):

    Code Ruby:
    ThinkingSphinx::Index.define :user, :with => :active_record do
      # fields
      indexes name, :as => :user, :sortable => true
      indexes [ethnicity, religion, about_me, sexuality, children, user_smoke, user_drink, age, gender]
    # attributes
      has id, created_at, updated_at

    I have nothing for thinking sphinx inside my User model, not sure if I need to go that route. Any help would be appreciated
    Last edited by Mittineague; Aug 9, 2013 at 19:35. Reason: reformatting bbcode tags
    Founder and CEO of

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts