Skip to content

Elasticsearch::Persistence::Repository#index_exists? silently drops arguments #852

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

Closed
fnordfish opened this issue Oct 17, 2018 · 4 comments

Comments

@fnordfish
Copy link

fnordfish commented Oct 17, 2018

I was just upgrading and ran into an issues when trying to use my_repository.index_exists?(index: "my_index_name")

In https://github.com/elastic/elasticsearch-rails/blob/master/elasticsearch-persistence/lib/elasticsearch/persistence/repository.rb#L213-L215

While I can still pass in an explicit :index, all arguments are ignored and the repositories index_name is used instead.

This is a bit surprising, I would expect the method to either use the passed in argument or raise an ArgumentError if passing an index name is not desired.

@fnordfish fnordfish changed the title Elasticsearch::Persistence::Repository Elasticsearch::Persistence::Repository#index_exists? silently drops arguments Oct 17, 2018
@estolfo
Copy link
Contributor

estolfo commented Oct 17, 2018

Hi @fnordfish Thanks for reporting this! I've opened a pull request to fix it here
Can you try it out in your testing environment and let me know if it resolves the issue for you? Thanks!

@fnordfish
Copy link
Author

Thanks! Works for me :)

@estolfo
Copy link
Contributor

estolfo commented Oct 17, 2018

@fnordfish glad to hear it, thanks for testing!

@estolfo
Copy link
Contributor

estolfo commented Oct 31, 2018

I'm going to close this as a fix was merged. See above for pull request reference.

@estolfo estolfo closed this as completed Oct 31, 2018
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

No branches or pull requests

2 participants