As everyone is aware in your searchable model you can define an index of type :text as well as :string, for example:
class Post < ActiveRecord::Base
searchable do
string :title
text :title, :body
end
I tried searching for the basic differences between a text field type and string field type and was able to get a basic understanding like:
- Text field types are tokenized , and this makes doing full text search within them very fast.
- You cannot use order_by i.e sorting on a text filed , and if you need sorting on that field you need to define it as :string.
So what i am looking for here is all the CONCEPTUAL as well as USAGE differences between a text field type and string field type so that i can weigh my opinions while defining a field as string or text or both.
Note: I am not saying that you provide all the differences in a single answer, one difference per answer will also do and but please make sure the difference you are giving is not given already.