I am experiencing some issues with Thinking Sphinx not allowing me to 
search by the deleted_at column in my database.

Essentially, I would like to get a list of all users, active users and 
deleted users, then be able to undelete certain users defined by the admin. 
Unfortunately, I can't even list the deleted users when using Thinking 
Sphinx. When I do a regular search for all users where 'deleted_at IS NOT 
NULL', I can get the users.

I can do any other field in my index just fine, but not deleted_at. Each 
time, I get this:


ERROR -- : index user_core: no such filter attribute 'deleted_at' 
(ThinkingSphinx::SphinxError)

This is my index file:


ThinkingSphinx::Index.define :user, :with => :active_record, :delta => true do 
  indexes first_name, :sortable => true 
  indexes last_name, :sortable => true 
  indexes email, :sortable => true 
  indexes phone, :sortable => true 
  has deleted_at, :as => :deleted 
  has id, :as => :user_id 
  has roles(:id), :as => :role_ids 
  set_property :delta => true 
end 


And my query:

params[:with][:deleted_at] = 0 

@results = User.search :conditions => params[:conditions], :with => 
params[:with], :order => params[:sort] + ' ' + params[:sort_mode], 
:page => params[:page], :per_page => params[:per_page], :star => true

NOTE: Even if I do just @results = User.search, I still get a list of only 
all active users where deleted_at is null. I do not seem to be able to get 
all users when using Thinking Sphinx. I have also tried 
params[:with][:deleted] with similar results.

-- 
You received this message because you are subscribed to the Google Groups 
"Thinking Sphinx" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/thinking-sphinx.
For more options, visit https://groups.google.com/d/optout.

Reply via email to