【问题标题】:Tire :include_in_all => false but fields are still included in _all轮胎 :include_in_all => false 但字段仍包含在 _all 中
【发布时间】:2012-10-10 18:57:01
【问题描述】:

我正在使用轮胎来实现对 rails 应用程序的搜索。 该应用由实现 ActiveModel 的 CouchDB 和 couchrest_model gem 提供支持。

从自述文件中可以看出有一个选项 :include_in_all 它没有解释它的行为,但我认为查询 _all 时不会包含索引

给定以下映射

mapping do
  indexes :id,                :index    => 'not_analyzed', :include_in_all => false
  indexes :title,             :analyzer => 'snowball', :boost => 100
  indexes :question_content,  :analyzer => 'snowball'
  indexes :skill_id,          :index    => 'not_analyzed', :include_in_all => false
  indexes :topic_id,          :index    => 'not_analyzed', :include_in_all => false
  indexes :archived,          :type     => 'boolean', :include_in_all => false
  indexes :created_at,        :type     => 'date', :index => 'not_analyzed', :include_in_all => false
  indexes :published_at,      :type     => 'date', :index => 'not_analyzed', :include_in_all => false
end

我希望 ES 在未在查询中指定 default_field 时仅搜索 titlequestion_content 的索引。

我错过了理解还是这是一个错误?

//编辑

删除索引并重新创建它会识别我设置的 include_in_all 选项。

【问题讨论】:

    标签: ruby elasticsearch tire


    【解决方案1】:

    删除索引并重新创建它会识别我设置的 include_in_all 选项。

    【讨论】:

      猜你喜欢
      • 2013-12-20
      • 2017-07-13
      • 1970-01-01
      • 2012-10-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-04-15
      相关资源
      最近更新 更多