Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/reference/migration/migrate_8_0.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ coming[8.0.0]
* <<breaking_80_network_changes>>
* <<breaking_80_transport_changes>>
* <<breaking_80_http_changes>>
* <<breaking_80_reindex_changes>>

//NOTE: The notable-breaking-changes tagged regions are re-used in the
//Installation and Upgrade Guide
Expand Down Expand Up @@ -55,3 +56,4 @@ include::migrate_8_0/java.asciidoc[]
include::migrate_8_0/network.asciidoc[]
include::migrate_8_0/transport.asciidoc[]
include::migrate_8_0/http.asciidoc[]
include::migrate_8_0/reindex.asciidoc[]
10 changes: 10 additions & 0 deletions docs/reference/migration/migrate_8_0/reindex.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[float]
[[breaking_80_reindex_changes]]
=== Reindex changes

Reindex from remote would previously allow URL encoded index-names and not
re-encode them when generating the search request for the remote host. This
leniency has been removed such that all index-names are correctly encoded when
reindex generates remote search requests.

Instead, please specify the index-name without any encoding.
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,6 @@ private static void addIndices(StringBuilder path, String[] indices) {
}

private static String encodeIndex(String s) {
if (s.contains("%")) { // already encoded, pass-through to allow this in mixed version clusters
checkIndexOrType("Index", s);
return s;
}
try {
return URLEncoder.encode(s, "utf-8");
} catch (UnsupportedEncodingException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,13 @@ public void testIntialSearchPath() {
assertEquals("/%3Ccat%7Bnow%2Fd%7D%3E,%3C%3E%2F%7B%7D%7C%2B%3A%2C/c,d/_search",
initialSearch(searchRequest, query, remoteVersion).getEndpoint());

// pass-through if already escaped.
// re-escape already escaped (no special handling).
searchRequest.indices("%2f", "%3a");
assertEquals("/%2f,%3a/c,d/_search", initialSearch(searchRequest, query, remoteVersion).getEndpoint());

// do not allow , and / if already escaped.
assertEquals("/%252f,%253a/c,d/_search", initialSearch(searchRequest, query, remoteVersion).getEndpoint());
searchRequest.indices("%2fcat,");
expectBadStartRequest(searchRequest, "Index", ",", "%2fcat,");
assertEquals("/%252fcat%2C/c,d/_search", initialSearch(searchRequest, query, remoteVersion).getEndpoint());
searchRequest.indices("%3ccat/");
expectBadStartRequest(searchRequest, "Index", "/", "%3ccat/");
assertEquals("/%253ccat%2F/c,d/_search", initialSearch(searchRequest, query, remoteVersion).getEndpoint());

searchRequest.indices("ok");
searchRequest.types("cat,");
Expand Down