The indexes keyword adds a text value to your index. This will make the
string representation of your rent value searchable, but no integer
appropriate actions (ranges, less than, greater than, etc) will work on
it.
Try using "has :rent" instead, this will add the rent int to your index
as an integer attribute and ranges should work.
-- James Healy <jimmy-at-deefa-dot-com> Mon, 16 Mar 2009 09:02:06 +1100
KJF wrote:
>
> I have the following index setup
>
> indexes rent
>
> where rent is an integer in my model.
>
> Whenever I try and search between a range of integers nothing ever
> gets matched.
>
> So something simple like
>
> search params[:query], :page => params[:page], :per_page =>
> 10, :conditions => { :rent => 0..500 }
>
> returns nothing even though I have many entries in my database
> with :rent between the ranges 0 and 500.
>
> Any ideas?
>
> >
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---