Hi folks,

i want to search for customers with are "active".
a customer is active if he owns about one or more domains OR one or
more contracts.

A customer has many domains.
A customer has many contracts.

I want to set a scope for ignoring the nominal members.
But i am not sure how to build my index for setting the scope without
sql statements.

define_index do
...
 indexes domains(:name), :as => :domains
 indexes contracts(:contract_no), :as => contracts
 has domains(:customer_id), :as => :customer_domain_ids
 has contracts(:customer_id), :as => :customer_contract_ids
end


sphinx_scope(:active) do
 {...}
end

Customer.active.search(...)

Is it possible to build this?
Can someone help me with this?

-- 
You received this message because you are subscribed to the Google Groups 
"Thinking Sphinx" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/thinking-sphinx?hl=en.

Reply via email to