You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description of the problem including expected versus actual behavior: When I try to remove an alias from multiple indices at once in a single remove action, the "Indices" property is converted to a comma separated list instead of an array with index names.
When I catch the request it looks like:
Steps to reproduce:
Code sample is
var actions = new IndexUpdateAliasesAction[] {
IndexUpdateAliasesAction.Add(new AddAction(){Alias = Tenant, Index = RecordIndexName(newVersion)}),
IndexUpdateAliasesAction.Add(new AddAction(){Alias = Tenant, Index = ClassificationIndexName(newVersion)}),
IndexUpdateAliasesAction.Add(new AddAction(){Alias = Tenant, Index = SuggestionIndexName(newVersion)}),
IndexUpdateAliasesAction.Add(new AddAction(){Alias = RecordAlias, Index = RecordIndexName(newVersion)}),
IndexUpdateAliasesAction.Add(new AddAction(){Alias = ClassificationAlias, Index = ClassificationIndexName(newVersion)}),
IndexUpdateAliasesAction.Add(new AddAction(){Alias = SuggestionAlias, Index = SuggestionIndexName(newVersion)})
};
if(deprecatedIndexNames != null && deprecatedIndexNames.Any())
{
var indicesNames = Indices.Parse(string.Join(",", deprecatedIndexNames));
actions = actions.Concat(new IndexUpdateAliasesAction[] { IndexUpdateAliasesAction.Remove(new RemoveAction() { Alias = Tenant, Indices = indicesNames }) }).ToArray();
}
@cguedel The preferred solution affects all language clients (as it must be fixed in the specification) and requires careful planning. We had an initial brainstorming regarding this issue, but large parts of the team (including me) is on PTO or will be on PTO this month, so please don't expect an immediate fix.
In the meantime, this issue can be worked around by using multiple actions with a single index name instead of a single action with multiple index names.
Elastic.Clients.Elasticsearch version: 8.14.4
Elasticsearch version: 8.8.2
.NET runtime version: .NET Framework 4.8.9241.0
Operating system version: Win 11
Description of the problem including expected versus actual behavior: When I try to remove an alias from multiple indices at once in a single remove action, the "Indices" property is converted to a comma separated list instead of an array with index names.
When I catch the request it looks like:
POST /_aliases
{
"actions": [
...
{
"remove": {
"alias": "tenant-1_unittests",
"indices": "tenant-1_unittests_classification_v1,tenant-1_unittests_suggestion_v1,tenant-1_unittests_record_v1"
}
}
]
}
Steps to reproduce:
Code sample is
var actions = new IndexUpdateAliasesAction[] {
IndexUpdateAliasesAction.Add(new AddAction(){Alias = Tenant, Index = RecordIndexName(newVersion)}),
IndexUpdateAliasesAction.Add(new AddAction(){Alias = Tenant, Index = ClassificationIndexName(newVersion)}),
IndexUpdateAliasesAction.Add(new AddAction(){Alias = Tenant, Index = SuggestionIndexName(newVersion)}),
};
if(deprecatedIndexNames != null && deprecatedIndexNames.Any())
{
var indicesNames = Indices.Parse(string.Join(",", deprecatedIndexNames));
actions = actions.Concat(new IndexUpdateAliasesAction[] { IndexUpdateAliasesAction.Remove(new RemoveAction() { Alias = Tenant, Indices = indicesNames }) }).ToArray();
}
var response = await _elasticClient.Indices.UpdateAliasesAsync(new UpdateAliasesRequest()
{
Actions = actions
}, cancellationToken).ConfigureAwait(false);
Expected behavior
The request should (I believe) look like:
POST /_aliases
{
"actions": [
...
{
"remove": {
"alias": "tenant-1_unittests",
"indices": ["tenant-1_unittests_classification_v1","tenant-1_unittests_suggestion_v1","tenant-1_unittests_record_v1"]
}
}
]
}
When I try this, it seems to work OK.
I probably can work around this by adding multiple remove actions.
Provide
ConnectionSettings
(if relevant):Provide
DebugInformation
(if relevant):The text was updated successfully, but these errors were encountered: