I am trying to create a grouped facet as follows:

Price
- Under £50 (123)
- £50 or over (12)

This is my index definition:

define_index do
  indexes "''", :as => :empty
  has "IF(price <50, true, false)", :as => :price_lt_50, :type
=> :boolean, :facet => true
  has "IF(price >=50, true, false)", :as => :price_gte_50, :type
=> :boolean, :facet => true
end

I have checked the SQL that TS generates, and it correctly returns
true or false depending on the price. However, after I have reindexed,
when I query the facets in Rails, empty hashes are returned as
follows:

> Item.facets
> {:price_lt_50=>{}, :price_gte_50=>{}}

What am I doing wrong?

Many thanks
Greg

-- 
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