Skip to content
This repository has been archived by the owner on Jun 30, 2018. It is now read-only.

update_index failed with index_prefix #895

Open
arthurccube opened this issue Oct 28, 2013 · 3 comments
Open

update_index failed with index_prefix #895

arthurccube opened this issue Oct 28, 2013 · 3 comments

Comments

@arthurccube
Copy link

My model Article can be searched via tire after I rake
"rake environment tire:import CLASS='Article'

However, I tried to update_index for new records, even include the Callbacks, it failed. I bet the index_prefix causing the problem.


include Tire::Model::Search
index_prefix "#{Rails.application.class.parent_name.downcase}_#{Rails.env.to_s.downcase}"
include Tire::Model::Callbacks


@karmi
Copy link
Owner

karmi commented Oct 28, 2013

Put Tire.configure { logger STDERR, level: "debug" } in your initializer/controller/etc to see what's going on in ES

@arthurccube
Copy link
Author

I added

config/environments/development.rb

Tire.configure { logger STDERR, level: "debug" }

app/models/article.rb

after_save {
Rails.logger.debug("Start index here...........")
self.index.store self
Rails.logger.debug("Finished index here...........")
}

Restart, then

After created a new record:
log/development.log -

Start index here...........
SELECT users.* FROM users WHERE users.id = 21 LIMIT 1
SELECT profiles.* FROM profiles WHERE profiles.user_id = 21 LIMIT 1ESC[0m
Finished index here...........

/elasticsearch/logs/elasticsearch.log - Nothing appened

Is there any config I missed?

@arthurccube
Copy link
Author

Besides, after I run the rake tasts, the items can be searched.
RAILS_ENV=development rake environment tire:import CLASS='Article' FORCE=true

the after_save callbacks still fails.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants