As everyone knows in your searchable model, you can define an index of type: text and also: string, for example:
class Post < ActiveRecord::Base searchable do string :title text :title, :body end
I tried to find the main differences between the type of the text field and the type of the string field and was able to get a basic understanding, for example:
- Types of text fields are tokenized, which makes finding text in the text very fast.
- You cannot use order_by ie to sort in a text file, and if you need sorting in this field, you need to define it as: string.
So, I am looking here for all the CONCEPTUAL , as well as USING the differences between the type of the text field and the type of the field field, so that I can weigh my opinions while defining the field as a string, text, or both.
Note: I am not saying that you provide all the differences in one answer, and one difference for the answer will also be made, but please make sure that the difference you give is not already indicated.
ruby-on-rails solr sunspot
Sahil dhankhar
source share