!= not working in search query (thinking sphinx)

Still not working. I tried

@ allPost = Post.search params[:search], :conditions =>["account_status.to_i != ?", 0]

@ allPost = Post.search params[:search], :conditions =>"account_status.to_i != 0"

Mk 27 wrote:

Still not working. I tried

@ allPost = Post.search params[:search], :conditions =>["account_status.to_i != ?", 0]

@ allPost = Post.search params[:search], :conditions =>"account_status.to_i != 0"

Have a look at the documentation for sphinx/thinking sphinx - this isn't activerecord any more, or SQL. To quote the thinking sphinx docs:

Please keep in mind that Sphinx does not support SQL comparison operators – it has its own query language. The :conditions option must be a hash, with each key a field and each value a string.

In addition, :conditions is for doing full text searches against specific columns you have indexed - for filtering on attribute values you need to use the :with option.

Fred