views:

292

answers:

1

Hi,

I installed Sphinx and Thinking Sphinx on ruby-on-rails 2.3.2 and on Windows 7 pc.

First of all, if I run rake ts:start, it won't start at all. It keep saying "Starting..." and it never starts. Even though, the simple search(with no filtering nor conditions) works fine. When I try to add a filter, it won't return any record.

My model looks like this:

class Announcement < ActiveRecord::Base

  belongs_to :announcement_type
  belongs_to :user
  belongs_to :province
  has_many :announcement_favorites
  has_many :announcement_comments
  has_many :announcement_subscriptions
  has_many :announcement_views
  acts_as_taggable_on :tags #,:category

  validates_presence_of :title, :description, :expirationDate

  define_index do
    indexes title, :as => :title, :sortable => true
    indexes description, :as => :description, :sortable => true

    has province_id, :as => :province_id
  end

And I'm searching this way:

Announcement.search params[:announcement][:search].to_s, :with => {:province_id => 1} ,:page => params[:page], :per_page => 10

Based on all the great documentation Thinking Sphinx has, and all the posts I've read about it, I can't understand what I'm doing wrong.

I just want to clarify that after I modify the index, I run the rake ts:index, ts:config commands and then I restart the searchd windows service just in case, and so the application, just to make sure everything is refreshed.

Thanks in advance,

Brian

A: 

I thought it was :conditions => {:province_id => 1} instead

Marcos Toledo