Hi Kyle

Sphinx expects comma delimited values, not sure how it handles spaces - but you 
can give it a shot.

First, just try defining the attribute with an explicit type:
  has numbers, :type => :multi

If that doesn't work (TS may still be making assumptions):
  has 'numbers', :as => :numbers, :type => :multi

And finally, if Sphinx chokes on the spaces:
  has "REPLACE(numbers, ' ', '')", :as => :numbers, :type => :multi

And it's nice to see REPLACE exists in both MySQL and PostgreSQL :)

Cheers

-- 
Pat

On 04/03/2011, at 10:38 PM, Kyle Murphy wrote:

> One field in my model looks like this: "123, 456, 789"  (or any
> number).  Could I index those numbers as MVAs on my model?
> 
> Which might look like:
> 
> define_indexes do
>  ...
>  has numbers => self.numbers.split(", ")
> end
> 
> Or something like that?  Hopefully that makes sense.
> 
> Thank you for any help.
> 
> -- 
> 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.
> 

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