Я использую: Ruby версия 2.4.0 и Rails 5.2.3, aws Экземпляр Ec2 с CentOS 7 Приложение использует gem searchkiq для эластичного поиска.
Мои модели, которые используют searchkiq как:
class ThreeDGarment < ApplicationRecord
validates :three_d_model_id, :category_id, :pieces, :body, :fabric, :total_length, :chest, :waist, :hip, presence: true
has_many :three_d_garment_images, dependent: :destroy
has_many :tukabank_order_items, as: :itemable
has_one :garment_efm
has_one :garment_edm
has_one :garment_pattern
belongs_to :three_d_model
belongs_to :category
mount_uploader :thumbnail, ThreeDGarmentThumbnailUploader
validates_presence_of :thumbnail
## To add the functionality of elastic search
searchkick
## parameters `to be searched by elastic search
def search_data
{
category: category.try(:name),
chest: chest,
total_length: total_length,
waist: waist,
hip: hip,
body: body,
}
end
end
при повторной индексации модели ThreeDGarment в консоли rails в рабочей модели выдается следующая ошибка:
2.4.0 :014 > ThreeDGarment.reindex
Elasticsearch::Transport::Transport::Errors::BadRequest: [400]
{"error":{"root_cause":[{"type":"mapper_parsing_exception",
"reason":"Root mapping definition has unsupported parameters:
[three_d_garment : {_routing={}, dynamic_templates=[
{string_template={mapping={ignore_above=30000, type=keyword,
fields={analyzed={analyzer=searchkick_index, index=true, type=text}}},
match_mapping_type=string, match=*}}], properties={}}]"}],
"type":"mapper_parsing_exception","reason":"Failed to parse mapping
[_doc]: Root mapping definition has unsupported parameters:
[three_d_garment : {_routing={}, dynamic_templates=
[{string_template={mapping={ignore_above=30000, type=keyword,
fields={analyzed={analyzer=searchkick_index, index=true, type=text}}},
match_mapping_type=string, match=*}}], properties={}}]",
"caused_by":{"type":"mapper_parsing_exception",
"reason":"Root mapping definition has unsupported parameters:
[three_d_garment : {_routing={}, dynamic_templates=
[{string_template={mapping={ignore_above=30000, type=keyword,
fields={analyzed={analyzer=searchkick_index, index=true, type=text}}},
match_mapping_type=string, match=*}}], properties={}}]"}},"status":400}
Я использую elasti c сервер поиска: репозиторий Elasticsearch для 7.x пакеты и работает на