-
Notifications
You must be signed in to change notification settings - Fork 368
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
Add ability to skip index existence checks on each import #483
Conversation
e8462fd
to
7f66cdd
Compare
7f66cdd
to
4e5694e
Compare
lib/chewy.rb
Outdated
|
||
def create_indices | ||
eager_load! | ||
Chewy::Index.descendants.each(&:create) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
create!
would be better, also, create_indices!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll add both just to be able to use what we need
lib/chewy/type/import.rb
Outdated
@@ -237,6 +237,11 @@ def fetch_indexed_objects(objects) | |||
|
|||
indexed_objects | |||
end | |||
|
|||
def assure_index_existence(index_options) | |||
return if Chewy.configuration[:strict_index_creation] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we invert it and call skip_index_creation_on_import
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay
471f4a0
to
c6be99f
Compare
It is configurable by `skip_index_creation_on_import` parameter in `config/chewy.yml`.
c6be99f
to
04d2fb6
Compare
It is configurable by
skip_index_creation_on_import
parameter inconfig/chewy.yml
.