Permalink
Browse files

use sql_attr_string for sortable instead of str2ordinal since that do…

…esn't work with delta indexes
  • Loading branch information...
1 parent 532f7b0 commit a6f7fce1d3baeb8a36206f2ef7fd9f1650bf2b28 @ninjudd committed Oct 2, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/minisphinx.rb
View
@@ -78,7 +78,7 @@ def configuration(opts)
"sql_user = #{db[:username]}",
"sql_query_info = #{sql_query_info}",
fields.collect do |field|
- "sql_attr_#{field.type} = #{field.name}" if field.type != :string
+ "sql_attr_#{field.type} = #{field.name}" if field.type != :text
end,
])
str << Minisphinx.config_block("source #{name} : #{name}_base", [
@@ -146,8 +146,8 @@ class Field
:date => :timestamp,
:datetime => :timestamp,
:timestamp => :timestamp,
- :text => :string,
- :sortable => :str2ordinal,
+ :string => :text,
+ :sortable => :string,
}
def initialize(opts)
@@ -181,7 +181,7 @@ def type
column = model_class.columns_hash[name]
@type = column.sql_type == 'bigint' ? :bigint : column.type.to_sym
end
- TYPE_MAP[@type] || @type || :string
+ TYPE_MAP[@type] || @type || :text
end
def to_s

0 comments on commit a6f7fce

Please sign in to comment.