Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Temporarily disable searchkick #88

Merged
merged 2 commits into from
Dec 27, 2013
Merged

Temporarily disable searchkick #88

merged 2 commits into from
Dec 27, 2013

Conversation

jtomaszewski
Copy link
Contributor

I have some rake tasks when I do mass edit on almost all my models. Thus it reindexes all models one-by-one, which is expensive (1000000 requests to ElasticSearch instead of bulk requests).

Do you think searchkick_enable and searchkick_disablemethods would be okay inmodel.rb` ?, so I could do:

Product.searchkick_disable
MyProductsExpensiveTask.execute
Product.searchkick_enable
Product.reindex

Maybe there should be also a global way to turn it off and on, for all models:

Searchkick.disable
Searchkick.enable

What do you think?

@ankane
Copy link
Owner

ankane commented Dec 21, 2013

Yeah, that'd be great. The feature has been on my list for a while. #35 Feel free to take a stab at it.

@jtomaszewski
Copy link
Contributor Author

Here it is.

Note: It's based on master, so it'll have to be merged with my other feature/should-index branch , if you want to pull them both at once.

@ankane ankane merged commit d43b42b into ankane:master Dec 27, 2013
@ankane
Copy link
Owner

ankane commented Dec 27, 2013

Awesome, thanks for adding this as well! I changed the method names slightly to more accurately reflect what they do.

Product.disable_search_callbacks
Product.enable_search_callbacks
Searchkick.disable_callbacks
Searchkick.enable_callbacks

@jtomaszewski jtomaszewski deleted the feature/searchkick-disable branch February 25, 2014 13:12
@lock lock bot locked as resolved and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants