If your column pairs directly to a Sphinx type (integer, boolean, string, float, timestamp/datetime), then attributes of that column - whether it's through an association or not - will have that type.
Date, text and decimal columns are treated as timestamp, string and float types, respectively. For anything else - or anything where you're opting for a SQL snippet, instead column and association references - you will need to specify a type manually. And this all applies to attributes - as far as Sphinx is concerned, no matter the database type, fields are strings. Hope this clears things up :) -- Pat On 09/03/2013, at 11:08 AM, Ngan wrote: > Hi, I'm a little bit unclear when I need to specify the "type" option in > define_index? > > e.g. > > define_index do > has foo(:cool), type: :boolean > end > > Will TS just know that the column is boolean or integer? Or do I always need > to specify. Specifically, i'm joining another table/model's attribute. > > Thanks! > > -- > 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 http://groups.google.com/group/thinking-sphinx?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > > -- 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 http://groups.google.com/group/thinking-sphinx?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
