gpt4 book ai didi

ruby - elasticsearch在EC2 centos的生产实例中与Nginx的生产中的Rails不兼容

转载 作者:行者123 更新时间:2023-12-03 02:24:13 28 4
gpt4 key购买 nike

我正在使用:Ruby版本2.4.0和Rails 5.2.3,带有CentOS 7的AWS Ec2实例
应用程序使用searchkiq gem进行elasticsearch。

我的模型使用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

当我在生产模型的rails控制台中为Model ThreeDGar​​ment重新编制索引时,出现以下错误:
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}

我正在运行 Elasticsearch 服务器:7.x软件包的Elasticsearch存储库,并在以下位置运行

最佳答案

删除旧版本的searchkiq gem,并将其更新为Gemfile中的以下版本:

gem 'searchkick', '~> 4.01'

该版本与Elasticsearch 7.x兼容

用于 gem 'searchkick', '~> 3.1', '>= 3.1.2'这适用于 elasticseatch 6.x

关于ruby - elasticsearch在EC2 centos的生产实例中与Nginx的生产中的Rails不兼容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61529613/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com