Searching and sorting by a float field with thinking sphinx
        Posted  
        
            by nathan Verni
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by nathan Verni
        
        
        
        Published on 2009-05-18T19:06:51Z
        Indexed on 
            2010/06/01
            0:03 UTC
        
        
        Read the original article
        Hit count: 236
        
ruby-on-rails
|sphinx
I'm using thinking sphinx to for search on a rails app. I have a float field called 'height'. I need to be able to search this field for exact values (i.e. exactly 6.0, not 6.5). I also need to be able to sort on the field.
What I have so far:
indexes height, :sortable => true
Problem: doesn't sort properly, returns 6.0 and 6.5 if I search for '6'
© Stack Overflow or respective owner