0

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. My environment is staging but when i perform a search via a rest api i get an error

{
  "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. What is causing this?

2
  • 1
    Hard to tell without some more information. Commented Jul 8, 2015 at 10:13
  • I would gladly provide more information but i'm new to elasticsearch and elasticsearch-rails gem so i quite don't know what data to provide. Commented Jul 8, 2015 at 10:15

2 Answers 2

1

Have you indexed the product? May be it will solve the issue.

Thanks!

Sign up to request clarification or add additional context in comments.

2 Comments

The index was not actually created which is odd. Product.import created the index locally, but on the server - no. I had to create it on my own by Product.create_index. Product is my model.
Yes rake task is fine. You can do it in a callback after_commit. vote my ans plz.
0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.