SwapAlias fails second time on 6.x-codecomplete-netcore
matbarker opened this issue · 4 comments
matbarker commented
Steps to Reproduce:
Clone the repository and run it, stop it, run it again.
NuSearch.Indexer.Program.SwapAlias() {...}
fails on the call to Client.Alias(...);
with the message:
Invalid NEST response built from a unsuccessful low level call on POST: /_aliases
# Audit trail of this API call:
- [1] BadResponse: Node: http://localhost:9200/ Took: 00:00:00.0233763
# OriginalException: Elasticsearch.Net.ElasticsearchClientException: Request failed to execute. ServerError: Type: illegal_argument_exception Reason: "The provided expression [nusearch] matches an alias, specify the corresponding concrete indices instead."
Version
Running ElasticSearch v 6.3.0
ccoulson commented
I was going through the directions on 6.x-netcore and ran into the same issue. I solved it by changing the line:
aliases.Add(a => a.Alias(NuSearchConfiguration.OldIndexAlias).Index(NuSearchConfiguration.LiveIndexAlias));
to:
aliases.Add(a => a.Alias(NuSearchConfiguration.OldIndexAlias).Index(Client.GetIndicesPointingToAlias(NuSearchConfiguration.LiveIndexAlias).First()));
ccoulson commented
Done!