elasticsearch,tire,Ruby On Rails,elasticsearch,Tire" /> elasticsearch,tire,Ruby On Rails,elasticsearch,Tire" />

Ruby on rails Elasticsearch/Rails轮胎自动完成多个字段

Ruby on rails Elasticsearch/Rails轮胎自动完成多个字段,ruby-on-rails,elasticsearch,tire,Ruby On Rails,elasticsearch,Tire,我在Rails模型中的Elasticsearch中有以下索引: mapping do indexes :id, type: "integer", index: :not_analyzed, include_in_all: false indexes :number, type: "string" indexes :title,

我在Rails模型中的Elasticsearch中有以下索引:

  mapping do
    indexes :id,                                type: "integer",  index: :not_analyzed, include_in_all: false
    indexes :number,                            type: "string"
    indexes :title,                             type: "string"
    indexes :description,                       type: "string"
    indexes :creation_date,                     type: "date",     index: :not_analyzed, include_in_all: false
    indexes :photographer,                      type: "integer",  index: :not_analyzed, include_in_all: false
    indexes :photographer_name,                 type: "string",   as: Proc.new { photographer.name if photographer }
    indexes :original_type,                     type: "integer",  index: :not_analyzed, include_in_all: false
    indexes :original_type_description,         type: "string",   as: Proc.new { original_type.description if original_type }
    indexes :format_type,                       type: "integer",  index: :not_analyzed, include_in_all: false
    indexes :format_type_description,           type: "string",   as: Proc.new { format_type.description if format_type }
    indexes :country,                           type: "integer",  index: :not_analyzed, include_in_all: false
    indexes :country_name,                      type: "string",   as: Proc.new { country.name if country }
    indexes :state,                             type: "integer",  index: :not_analyzed, include_in_all: false
    indexes :state_name,                        type: "string",   as: Proc.new { state.name if state }
    indexes :state_region,                      type: "string",   as: Proc.new { state.region if state }
    indexes :locality,                          type: "string"
    indexes :license_type,                      type: "integer",  index: :not_analyzed, include_in_all: false
    indexes :license_type_description,          type: "string",   as: Proc.new { license_type.description if license_type }
    indexes :model_release_type,                type: "integer",  index: :not_analyzed, include_in_all: false
    indexes :model_release_type_description,    type: "string",   as: Proc.new { model_release_type.description if model_release_type }
    indexes :property_release_type,             type: "integer",  index: :not_analyzed, include_in_all: false
    indexes :property_release_type_description, type: "string",   as: Proc.new { property_release_type.description if property_release_type }
    indexes :keywords,                          type: "string",   as: Proc.new { keywords.map(&:value) }
  end
我需要实现一个
autocomplete
字段,并找到了很多资料,包括在这里,教我如何使用
Elasticsearch
和Tire来实现这一点。但是,它们都只基于索引中的一个字段显示建议

我需要
autocomplete
字段建议几个字段中的术语,例如标题、摄影师和关键字。此外,字段关键字是一个数组,即包含多个单词