2

我正在使用轮胎来实现对 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 时搜索title索引question_content

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

//编辑

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

4

1 回答 1

0

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

于 2012-10-10T10:57:01.087 回答