Skip to content

Conversation

@jfrolich
Copy link
Contributor

@jfrolich jfrolich commented Oct 9, 2018

All indices are deleted with the index name as the prefix, but if we have 'items' and 'items_test' it will also wipe out 'items_test', adding a dash to the filter will solve this problem in all cases as all indices are named 'items-[0-9]+' .

@coveralls
Copy link

coveralls commented Oct 9, 2018

Coverage Status

Coverage increased (+0.01%) to 98.0% when pulling 7ad220a on jfrolich:delete-right-indices into 18f3c51 on infinitered:master.

@danielberkompas
Copy link
Owner

Thanks for this suggestion! Wouldn't it be simpler to replace this:

https://github.com/infinitered/elasticsearch-elixir/blob/921531ee767127801367271a82ac1e4d2b587cad/lib/elasticsearch/indexing/index.ex#L38

with this?

:ok <- clean_starting_with(config, "#{alias}-", 2)

@jfrolich
Copy link
Contributor Author

Thanks for this suggestion! Wouldn't it be simpler to replace this:

elasticsearch-elixir/lib/elasticsearch/indexing/index.ex

Line 38 in 921531e

:ok <- clean_starting_with(config, alias, 2),
with this?

:ok <- clean_starting_with(config, "#{alias}-", 2)

Yep that was my first commit, but I figured people might have "posts" and "posts-test". This makes it more robust.

@danielberkompas
Copy link
Owner

@jfrolich that makes sense. Can you fix the test failure so that we can get this merged?

@jfrolich
Copy link
Contributor Author

Just pushed a working version

@danielberkompas danielberkompas merged commit a2a3bc9 into danielberkompas:master Oct 12, 2018
@danielberkompas
Copy link
Owner

Great, thanks! ⭐ ⭐ ⭐

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