-
Notifications
You must be signed in to change notification settings - Fork 2
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
Issue #255 - Create rake task for create indices in ElasticSearch. #256
Conversation
lib/tasks/elasticsearch.rake
Outdated
def reset_index(klass) | ||
client = Elasticsearch::Client.new( | ||
namespace :reset do | ||
|
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.
Extra empty line detected at block body beginning.
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.
Nice watch dog.
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 you also add a line to the bin/setup
script to call the rake elasticsearch:create:all_indices
task?
lib/tasks/elasticsearch.rake
Outdated
task reset_network_index: :environment do | ||
reset_index(Network) | ||
desc 'Deletes the "user" index and regenerates it with all records currently in List' | ||
task list_index: :environment do |
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.
Looks like a typo here, should this be user_index
?
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.
Funny. The typo exists before this PR 😆
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.
Fixed.
@ptrikutam I can't add the rake task to the setup script because the server needs to be started with foreman before run the task. |
d8ba742
to
70fbd8a
Compare
lib/tasks/elasticsearch.rake
Outdated
klass.import | ||
end | ||
|
||
desc 'Creates the "resource", "network", "user" and "list" indices and regenerates it with all records' |
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.
Line is too long. [107/100]
lib/tasks/elasticsearch.rake
Outdated
end | ||
|
||
klass.__elasticsearch__.create_index! force: true | ||
desc 'Deletes the "resource", "network", "user" and "list" indices and regenerates it with all records' |
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.
Line is too long. [107/100]
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.
@ptrikutam How I can skip this validation on hound?
@nsanta thanks for fixing the typo.
Gotcha. OK, no worries. Can you update this wording:
to
Or something to that effect. |
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.
Once you update the text feel free to merge! 👍
70fbd8a
to
746b9d8
Compare
746b9d8
to
24e649a
Compare
Related to issue #255
Also I added the proper namespace to the elastic_search reset tasks.