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

Issue #255 - Create rake task for create indices in ElasticSearch. #256

Merged
merged 4 commits into from
Sep 11, 2017

Conversation

nsanta
Copy link
Collaborator

@nsanta nsanta commented Sep 6, 2017

Related to issue #255

  • Added rake task for create indices on ElasticSearch for Resource, Network, List and User records.
  • Readme.md Updated.

Also I added the proper namespace to the elastic_search reset tasks.

def reset_index(klass)
client = Elasticsearch::Client.new(
namespace :reset do

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nice watch dog.

Copy link
Contributor

@ptrikutam ptrikutam left a 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?

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

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?

Copy link
Collaborator Author

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 😆

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed.

@nsanta
Copy link
Collaborator Author

nsanta commented Sep 8, 2017

@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.

@nsanta nsanta force-pushed the issue-255-create-index-task branch from d8ba742 to 70fbd8a Compare September 8, 2017 00:48
klass.import
end

desc 'Creates the "resource", "network", "user" and "list" indices and regenerates it with all records'

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]

end

klass.__elasticsearch__.create_index! force: true
desc 'Deletes the "resource", "network", "user" and "list" indices and regenerates it with all records'

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]

Copy link
Collaborator Author

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?

@ptrikutam
Copy link
Contributor

@nsanta thanks for fixing the typo.

@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.

Gotcha. OK, no worries. Can you update this wording:

If you get errors from ElasticSearch on startup, try running the following command in the Console:

to

You will need to run the following while you have foreman running in another terminal window, otherwise you will get ElasticSearch errors:

Or something to that effect.

Copy link
Contributor

@ptrikutam ptrikutam left a 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! 👍

@nsanta nsanta force-pushed the issue-255-create-index-task branch from 70fbd8a to 746b9d8 Compare September 8, 2017 22:43
@nsanta nsanta force-pushed the issue-255-create-index-task branch from 746b9d8 to 24e649a Compare September 11, 2017 22:53
@nsanta nsanta merged commit c04784b into master Sep 11, 2017
@nsanta nsanta deleted the issue-255-create-index-task branch September 11, 2017 22:59
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.

3 participants