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

Add ability to skip index existence checks on each import #483

Merged
merged 1 commit into from
Mar 16, 2017

Conversation

sergey-kintsel
Copy link
Contributor

@sergey-kintsel sergey-kintsel commented Mar 14, 2017

It is configurable by skip_index_creation_on_import parameter in
config/chewy.yml.

@sergey-kintsel sergey-kintsel force-pushed the make-index-existance-checks-configurable branch from e8462fd to 7f66cdd Compare March 14, 2017 12:09
@sergey-kintsel sergey-kintsel changed the title Add ability to skip index existance checks on each import Add ability to skip index existence checks on each import Mar 14, 2017
@sergey-kintsel sergey-kintsel force-pushed the make-index-existance-checks-configurable branch from 7f66cdd to 4e5694e Compare March 14, 2017 12:34
lib/chewy.rb Outdated

def create_indices
eager_load!
Chewy::Index.descendants.each(&:create)
Copy link
Contributor

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!

Copy link
Contributor Author

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

@@ -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]
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay

@sergey-kintsel sergey-kintsel force-pushed the make-index-existance-checks-configurable branch 3 times, most recently from 471f4a0 to c6be99f Compare March 15, 2017 10:12
It is configurable by `skip_index_creation_on_import` parameter in
`config/chewy.yml`.
@sergey-kintsel sergey-kintsel force-pushed the make-index-existance-checks-configurable branch from c6be99f to 04d2fb6 Compare March 16, 2017 02:01
@pyromaniac pyromaniac merged commit 537fb41 into master Mar 16, 2017
@pyromaniac pyromaniac deleted the make-index-existance-checks-configurable branch March 16, 2017 02:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants