Skip to content
This repository has been archived by the owner on Mar 31, 2024. It is now read-only.

Commit

Permalink
ESExporter - Specify index in url and not per index entry
Browse files Browse the repository at this point in the history
to allow indexing when `rest.action.multi.allow_explicit_index: false` is set.

Closes elastic#361
  • Loading branch information
bleskes committed Nov 15, 2014
1 parent c34016e commit 2d339a9
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ public void exportClusterStats(ClusterStatsResponse clusterStats) {

private HttpURLConnection openExportingConnection() {
logger.trace("setting up an export connection");
HttpURLConnection conn = openAndValidateConnection("POST", "_bulk", XContentType.SMILE.restContentType());
HttpURLConnection conn = openAndValidateConnection("POST", getIndexName() + "/_bulk", XContentType.SMILE.restContentType());
if (conn != null && (keepAliveThread == null || !keepAliveThread.isAlive())) {
// start keep alive upon successful connection if not there.
initKeepAliveThread();
Expand All @@ -233,7 +233,6 @@ private void addXContentRendererToConnection(HttpURLConnection conn,
for (int i = 0; i < renderer.length(); i++) {
XContentBuilder builder = XContentFactory.smileBuilder();
builder.startObject().startObject("index")
.field("_index", getIndexName())
.field("_type", renderer.type(i))
.endObject().endObject();
builder.close();
Expand Down

0 comments on commit 2d339a9

Please sign in to comment.