I use:
rails 4.1.1
ruby 2.1.1
thinking sphinx 3.1.1
mysql2
object_index.rb:
ThinkingSphinx::Index.define :object, :with => :active_record do
indexes price, :sortable => true
...
has created_at, updated_at
end
In sphinx config:
sql_attr_float = price
also try
sql_attr_uint = price
result was the same
When I try to search object wich price is between X and Y:
Object.search :with=> {:price => 100..900}
I got all records without between, but it work's.
When I try:
Object.search :conditions => {:with=> {:price => 100..800}}
or
Object.search :conditions => {:with=> {:price => 100.0..800.0}} for float
I got an error:
ThinkingSphinx::SphinxError: index object_core: unsupported filter type 'intrange' on string column - SELECT * FROM `object_core` WHERE `price` BETWEEN 100 AND 800 AND `sphinx_deleted` = 0 LIMIT 0, 20; SHOW META
or for float
ThinkingSphinx::SphinxError: index object_core: unsupported filter type 'floatrange' on string column - SELECT * FROM `object_core` WHERE `price` BETWEEN 100.0 AND 900.0 AND `sphinx_deleted` = 0 LIMIT 0, 20; SHOW META
How can I fix it and use search in range for price?
upd: schema.db when I make it integer problem was the same:
t.float "price", null: false
thinging_sphinx
generate this config file, put it here - http://pastebin.com/USGABqdt