I see no reason why this shouldn't work, but I get no results. A Contact
has many OrganizationContacts
. And OrganizationContact
has a boolean field primary
. I've added a filter on this field as shown below.
class Contact < ActiveRecord::Base
has_many :organization_contacts, :dependent => :destroy
define_index do
has organization_contacts(:primary), :as => :primary_contacts
set_property :delta => true
end
end
In a debugging session I can see that I do indeed have a Contact
with an OrganizationContact
that is listed as primary
:
(rdb:1) p Contact.first.organization_contacts.first.primary
true
But if I do a ThinkingSphinx
search using that filter, I get nothing:
(rdb:1) p Contact.search :with => { :primary_contacts => true }
[]
Can anyone explain?