Skip to content
This repository has been archived by the owner on Feb 7, 2020. It is now read-only.

Upgrade to elasticsearch 0.90.6 #53

Closed
wants to merge 1 commit into from
Closed
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: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<url>https://github.com/crate/elasticsearch-inout-plugin</url>
</scm>
<properties>
<elasticsearch.version>0.90.3</elasticsearch.version>
<elasticsearch.version>0.90.6</elasticsearch.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ protected ShardExportResponse shardOperation(ShardExportRequest request) throws
SearchShardTarget shardTarget = new SearchShardTarget(clusterService.localNode().id(), request.index(), request.shardId());
ExportContext context = new ExportContext(0,
new ShardSearchRequest().types(request.types()).filteringAliases(request.filteringAliases()),
shardTarget, indexShard.searcher(), indexService, indexShard, scriptService, cacheRecycler, nodePath);
shardTarget, indexShard.acquireSearcher("inout"), indexService, indexShard, scriptService, cacheRecycler, nodePath);
ExportContext.setCurrent(context);

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.support.broadcast.BroadcastOperationRequest;
import org.elasticsearch.common.Nullable;
import org.elasticsearch.common.Required;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.bytes.BytesArray;
import org.elasticsearch.common.bytes.BytesReference;
Expand Down Expand Up @@ -60,13 +59,11 @@ public BytesReference source() {
return source;
}

@Required
public ExportRequest source(String source) {
return this.source(new BytesArray(source), false);
}


@Required
public ExportRequest source(BytesReference source, boolean unsafe) {
this.source = source;
this.querySourceUnsafe = unsafe;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package crate.elasticsearch.action.import_;

import org.elasticsearch.action.support.nodes.NodesOperationRequest;
import org.elasticsearch.common.Required;
import org.elasticsearch.common.bytes.BytesArray;
import org.elasticsearch.common.bytes.BytesReference;
import org.elasticsearch.common.io.stream.StreamInput;
Expand Down Expand Up @@ -32,12 +31,10 @@ public BytesReference source() {
return source;
}

@Required
public ImportRequest source(String source) {
return this.source(new BytesArray(source), false);
}

@Required
public ImportRequest source(BytesReference source, boolean unsafe) {
this.source = source;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ protected ShardSearchIntoResponse shardOperation(ShardSearchIntoRequest
request.shardId());
SearchIntoContext context = new SearchIntoContext(0,
new ShardSearchRequest().types(request.types()).filteringAliases(request.filteringAliases()),
shardTarget, indexShard.searcher(), indexService, indexShard, scriptService, cacheRecycler
shardTarget, indexShard.acquireSearcher("inout"), indexService, indexShard, scriptService, cacheRecycler
);
SearchIntoContext.setCurrent(context);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.support.broadcast.BroadcastOperationRequest;
import org.elasticsearch.common.Nullable;
import org.elasticsearch.common.Required;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.bytes.BytesArray;
import org.elasticsearch.common.bytes.BytesReference;
Expand Down Expand Up @@ -63,13 +62,11 @@ public BytesReference source() {
return source;
}

@Required
public SearchIntoRequest source(String source) {
return this.source(new BytesArray(source), false);
}


@Required
public SearchIntoRequest source(BytesReference source, boolean unsafe) {
this.source = source;
this.querySourceUnsafe = unsafe;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import static org.elasticsearch.rest.RestRequest.Method.POST;
import static org.elasticsearch.rest.RestStatus.BAD_REQUEST;
import static org.elasticsearch.rest.RestStatus.OK;
import static org.elasticsearch.rest.action.support.RestActions.splitTypes;
import static org.elasticsearch.common.Strings.splitStringByCommaToArray;

import java.io.IOException;

Expand Down Expand Up @@ -52,7 +52,7 @@ protected Action<ExportRequest, ExportResponse, ExportRequestBuilder> action() {
}

public void handleRequest(final RestRequest request, final RestChannel channel) {
ExportRequest exportRequest = new ExportRequest(RestActions.splitIndices(request.param("index")));
ExportRequest exportRequest = new ExportRequest(splitStringByCommaToArray(request.param("index")));

if (request.hasParam("ignore_indices")) {
exportRequest.ignoreIndices(IgnoreIndices.fromString(request.param("ignore_indices")));
Expand All @@ -79,7 +79,7 @@ public void handleRequest(final RestRequest request, final RestChannel channel)
}
}
exportRequest.routing(request.param("routing"));
exportRequest.types(splitTypes(request.param("type")));
exportRequest.types(splitStringByCommaToArray(request.param("type")));
exportRequest.preference(request.param("preference", "_primary"));
} catch (Exception e) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import static org.elasticsearch.rest.RestRequest.Method.POST;
import static org.elasticsearch.rest.RestStatus.BAD_REQUEST;
import static org.elasticsearch.rest.RestStatus.OK;
import static org.elasticsearch.rest.action.support.RestActions.splitTypes;
import static org.elasticsearch.common.Strings.splitStringByCommaToArray;

import java.io.IOException;

Expand Down Expand Up @@ -55,7 +55,7 @@ protected Action<SearchIntoRequest, SearchIntoResponse, SearchIntoRequestBuilder
public void handleRequest(final RestRequest request,
final RestChannel channel) {
SearchIntoRequest searchIntoRequest = new SearchIntoRequest(
RestActions.splitIndices(request.param("index")));
splitStringByCommaToArray(request.param("index")));

if (request.hasParam("ignore_indices")) {
searchIntoRequest.ignoreIndices(IgnoreIndices.fromString(
Expand Down Expand Up @@ -90,7 +90,7 @@ public void handleRequest(final RestRequest request,
}
}
searchIntoRequest.routing(request.param("routing"));
searchIntoRequest.types(splitTypes(request.param("type")));
searchIntoRequest.types(splitStringByCommaToArray(request.param("type")));
searchIntoRequest.preference(request.param("preference",
"_primary"));
} catch (Exception e) {
Expand Down
2 changes: 1 addition & 1 deletion src/test/python/reindex.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ be closed first and then reopened::
>>> post("/test/_close", {})
{"ok":true,"acknowledged":true}
>>> put("/test/_settings", {"analysis": {"analyzer": {"myan": {"type": "stop", "stopwords": ["nice"]}}}})
{"ok":true}
{"ok":true,"acknowledged":true}
>>> post("/test/_open", {})
{"ok":true,"acknowledged":true}
>>> refresh()
Expand Down