简体   繁体   English

Elasticsearch-rails正在搜索错误的索引

[英]Elasticsearch-rails is searching in wrong index

I'm trying to deploy my app and index a model. 我正在尝试部署我的应用程序并为模型建立索引。 Everything is working fine until i'm trying to actually get the data from elasticsearch. 一切工作正常,直到我尝试从elasticsearch实际获取数据为止。 My environment is staging but when i perform a search via a rest api i get an error 我的环境正在升级,但是当我通过Rest API执行搜索时,出现错误

{
  "status": "error",
  "messages": 
  "[404]{\"error\":\"IndexMissingException[[myapp_production_products] missing]\",\"status\":404}"
}

From this: 由此:

[myapp_production_products]

i deduced that it's trying to query elasticsearch on wrong environment. 我推断它正在尝试在错误的环境上查询elasticsearch。 What is causing this? 是什么原因造成的?

Have you indexed the product? 您是否已将产品编入索引? May be it will solve the issue. 也许它将解决问题。

Thanks! 谢谢!

Ok, so the problem was not with bad index naming. 好的,所以问题不在于索引命名错误。 The index was not created at all, which is super weird (i made the same thing on my local machine and it was working, the index was created). 根本没有创建索引,这太奇怪了(我在本地计算机上做了同样的事情,并且正在运行,索引已创建)。

I just added a rake task for creating the index. 我刚刚添加了一个rake任务来创建索引。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM