4

What does :index => :not_analyzed do if I map it to a field or if I don't add it to a field? I couldn't find a definition on the main github tire page or in the elasticsearch.org website.

Example of the code:

class Article < ActiveRecord::Base
      include Tire::Model::Search
      include Tire::Model::Callbacks

      #...

      mapping do
        indexes :id,           :index    => :not_analyzed
        indexes :title,        :analyzer => 'snowball', :boost => 100
      end
end
perseverance
  • 6,372
  • 12
  • 49
  • 68

1 Answers1

3

Not analyzed means that the field is stored as is and it's not processed with analysis tools. If you analyze it, you can choose your analyzer. By default, a standard analyzer is applied. It breaks your content in tokens, lowercase them, remove punctuation, remove english stop words (as, is, are, ...)

I recommand to use the analyze API to understand the difference between analyzers: http://www.elasticsearch.org/guide/reference/api/admin-indices-analyze.html

Have a look at Analysis section for more details: http://www.elasticsearch.org/guide/reference/index-modules/analysis/

dadoonet
  • 14,109
  • 3
  • 42
  • 49