Skip to content

Commit

Permalink
Allow _update on write alias (#45318)
Browse files Browse the repository at this point in the history
Using the document update API on aliases with a write index does not work.

Follow-up to #31520
  • Loading branch information
ywelsch committed Aug 9, 2019
1 parent 07f65d9 commit 22dd667
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ protected void doStart(ClusterState clusterState) {
throw blockException;
}
}
request.concreteIndex(indexNameExpressionResolver.concreteSingleIndex(clusterState, request).getName());
request.concreteIndex(indexNameExpressionResolver.concreteWriteIndex(clusterState, request).getName());
resolveRequest(clusterState, request);
blockException = checkRequestBlock(clusterState, request);
if (blockException != null) {
Expand Down
3 changes: 2 additions & 1 deletion server/src/test/java/org/elasticsearch/update/UpdateIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,8 @@ public void testIndexAutoCreation() throws Exception {
}

public void testUpdate() throws Exception {
createTestIndex();
assertAcked(prepareCreate("test").addAlias(new Alias("alias").writeIndex(true)));
assertAcked(prepareCreate("test2").addAlias(new Alias("alias")));
ensureGreen();

Script fieldIncScript = new Script(ScriptType.INLINE, UPDATE_SCRIPTS, FIELD_INC_SCRIPT, Collections.singletonMap("field", "field"));
Expand Down

0 comments on commit 22dd667

Please sign in to comment.