Hi Pat Thanks for your reply.
Yes, I restarted Sphinx as well as re-indexing. I think I have found the problem. Does Sphinx require a certain amount of data before it creates an index? I am seeing the empty hashes when I run Item.facets, "no enabled local indexes to search" when I use Item.search, and "failed to load ~/railsapp/db/sphinx/development/ item_core.new.spa: bad size 0 (at least 64 bytes expected)" in my searchd.log. However, if I add a few lengthy text fields to my index definition, it all starts working. Any suggestions much appreciated. Many thanks Greg On Feb 3, 1:19 am, Pat Allan <[email protected]> wrote: > Hi Greg > > I'll start with the obvious, apologies if you're on top of this already: Did > you restart Sphinx as well as re-indexing? Restarting is required when you > change an index structure, or add or remove indexes. > > Cheers > > -- > Pat > > On 03/02/2011, at 12:30 AM, Greg wrote: > > > > > > > > > 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 > > athttp://groups.google.com/group/thinking-sphinx?hl=en. -- 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.
