【问题标题】:What does setting the index to not_analyzed do when index mapping using elasticsearch?使用 elasticsearch 进行索引映射时,将索引设置为 not_analyzed 有什么作用?
【发布时间】:2012-11-04 00:14:58
【问题描述】:

如果我将:index => :not_analyzed 映射到字段或不将其添加到字段,它会做什么?我在 github 轮胎主页面或 elasticsearch.org 网站上找不到定义。

代码示例:

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

【问题讨论】:

    标签: ruby-on-rails elasticsearch tire


    【解决方案1】:

    未分析表示该字段按原样存储并且未使用分析工具进行处理。 如果你分析它,你可以选择你的分析仪。默认情况下,应用标准分析器。它将您的内容分解为标记,将它们小写,删除标点符号,删除英语停用词(as, is, are, ...)

    我建议使用analyze API来了解分析器之间的区别:http://www.elasticsearch.org/guide/reference/api/admin-indices-analyze.html

    查看分析部分了解更多详情:http://www.elasticsearch.org/guide/reference/index-modules/analysis/

    【讨论】:

      猜你喜欢
      • 2016-05-08
      • 1970-01-01
      • 1970-01-01
      • 2017-01-10
      • 2012-09-04
      • 1970-01-01
      • 2017-03-11
      • 2015-06-29
      • 2014-04-15
      相关资源
      最近更新 更多