简体   繁体   English

Elasticsearch :: Transport :: Transport :: Errors :: NotFound([404] {“错误”:{“ root_cause”:[{“类型”:“ index_not_found_exception”

[英]Elasticsearch::Transport::Transport::Errors::NotFound ([404] {“error”:{“root_cause”:[{“type”:“index_not_found_exception”

Not sure while working in local environment with elasticsearch im getting this weird error, any help would me appreciated. 不确定在elasticsearch本地环境中工作时遇到此奇怪错误,我将不胜感激。 thanks 谢谢

Elasticsearch::Transport::Transport::Errors::NotFound ([404] {"error":{"root_cause":[{"type":"index_not_found_exception","reason":"no such index","resource.type":"index_or_alias","resource.id":"invoices","index":"invoices"}],"type":"index_not_found_exception","reason":"no such index","resource.type":"index_or_alias","resource.id":"invoices","index":"invoices"},"status":404}) Elasticsearch :: Transport :: Transport :: Errors :: NotFound([404] {“错误”:{“ root_cause”:[{“类型”:“ index_not_found_exception”,“原因”:“无此索引”,“资源。类型“:” index_or_alias“,” resource.id“:”发票“,”索引“:”发票“}]],”类型“:” index_not_found_exception“,”原因“:”无此类索引“,” resource.type“ :“ index_or_alias”,“ resource.id”:“发票”,“ index”:“发票”},“状态”:404})

Fixed issue by indexing ES by running these commands at rails console : - 通过在rails console运行以下命令来索引ES的固定问题:-

Model.__elasticsearch__.create_index!
Model.__elasticsearch__.create_index! force: true
Model.import force: true 

You can also follow this steps i find on rubydoc website : 您也可以按照我在rubydoc网站上找到的步骤进行操作

require the task definition in your application, eg. 在您的应用程序中需要任务定义,例如。 in the lib/tasks/elasticsearch.rake file: 在lib / tasks / elasticsearch.rake文件中:

require 'elasticsearch/rails/tasks/import'

To import the records from your model, run: 要从模型导入记录,请运行:

bundle exec rake environment elasticsearch:import:model CLASS='ModelName'

Or you can use: 或者您可以使用:

rake environment elasticsearch:import:all DIR=app/models

to import all models. 导入所有模型。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Elasticsearch :: Transport :: Transport :: Errors :: NotFound:[404] - Elasticsearch::Transport::Transport::Errors::NotFound: [404] Activeadmin破坏记录,并在管理中出现Elasticsearch :: Transport :: Transport :: Errors :: NotFound异常[404] - Activeadmin Destroy Record with Exception Elasticsearch::Transport::Transport::Errors::NotFound in Admin [404] Elasticsearch 6.2.4 [400] {“错误”:{“ root_cause”:[{“类型”:“ illegal_argument_exception”,“原因”:“文本为空(可能是HTTP / 0.9)”}]] - Elasticsearch 6.2.4 [400] {“error”:{“root_cause”:[{“type”:“illegal_argument_exception”,“reason”:“text is empty (possibly HTTP/0.9)”}] Elasticsearch ::运输::运输::错误:: BadRequest错误heroku - Elasticsearch::Transport::Transport::Errors::BadRequest error heroku Elasticsearch::Transport::Transport::Errors::BadRequest [400] 创建索引时 - Elasticsearch::Transport::Transport::Errors::BadRequest [400] while creating index Elasticsearch :: Transport :: Transport :: Errors :: NotAcceptable:[406] {“错误”:“不支持Content-Type标头[]”,“状态”:406} - Elasticsearch::Transport::Transport::Errors::NotAcceptable: [406] {“error”:“Content-Type header [] is not supported”,“status”:406} Elasticsearch::Transport::Transport::Errors::Forbidden: [403] 发送超过 1200 个字符的文本字段时出错 - Elasticsearch::Transport::Transport::Errors::Forbidden: [403] error when sending text fields with more than 1200 characters 搜索#search中的Rails:Elasticsearch :: Transport :: Transport :: Errors :: BadRequest - Rails: Elasticsearch::Transport::Transport::Errors::BadRequest in Search#search 使用ActiveAdmin,SearchKick和SearchBox在Heroku上出现Elasticsearch :: Transport :: Transport :: Errors - Elasticsearch::Transport::Transport::Errors on Heroku with ActiveAdmin, SearchKick and SearchBox # <RestClient::NotFound: 404 Not Found> 错误+其余客户宝石 - #<RestClient::NotFound: 404 Not Found> error + rest-client gem
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM