|
@@ -25,7 +25,6 @@ import static org.elasticsearch.rest.RestStatus.OK;
|
|
|
public class AsyncSearchResponse extends ActionResponse implements StatusToXContentObject {
|
|
|
@Nullable
|
|
|
private final String id;
|
|
|
- private final int version;
|
|
|
@Nullable
|
|
|
private final SearchResponse searchResponse;
|
|
|
@Nullable
|
|
@@ -40,19 +39,17 @@ public class AsyncSearchResponse extends ActionResponse implements StatusToXCont
|
|
|
* Creates an {@link AsyncSearchResponse} with meta-information only (not-modified).
|
|
|
*/
|
|
|
public AsyncSearchResponse(String id,
|
|
|
- int version,
|
|
|
boolean isPartial,
|
|
|
boolean isRunning,
|
|
|
long startTimeMillis,
|
|
|
long expirationTimeMillis) {
|
|
|
- this(id, version, null, null, isPartial, isRunning, startTimeMillis, expirationTimeMillis);
|
|
|
+ this(id, null, null, isPartial, isRunning, startTimeMillis, expirationTimeMillis);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* Creates a new {@link AsyncSearchResponse}
|
|
|
*
|
|
|
* @param id The id of the search for further retrieval, <code>null</code> if not stored.
|
|
|
- * @param version The version number of this response.
|
|
|
* @param searchResponse The actual search response.
|
|
|
* @param error The error if the search failed, <code>null</code> if the search is running
|
|
|
* or has completed without failure.
|
|
@@ -61,7 +58,6 @@ public class AsyncSearchResponse extends ActionResponse implements StatusToXCont
|
|
|
* @param startTimeMillis The start date of the search in milliseconds since epoch.
|
|
|
*/
|
|
|
public AsyncSearchResponse(String id,
|
|
|
- int version,
|
|
|
SearchResponse searchResponse,
|
|
|
ElasticsearchException error,
|
|
|
boolean isPartial,
|
|
@@ -69,7 +65,6 @@ public class AsyncSearchResponse extends ActionResponse implements StatusToXCont
|
|
|
long startTimeMillis,
|
|
|
long expirationTimeMillis) {
|
|
|
this.id = id;
|
|
|
- this.version = version;
|
|
|
this.error = error;
|
|
|
this.searchResponse = searchResponse;
|
|
|
this.isPartial = isPartial;
|
|
@@ -80,7 +75,6 @@ public class AsyncSearchResponse extends ActionResponse implements StatusToXCont
|
|
|
|
|
|
public AsyncSearchResponse(StreamInput in) throws IOException {
|
|
|
this.id = in.readOptionalString();
|
|
|
- this.version = in.readVInt();
|
|
|
this.error = in.readOptionalWriteable(ElasticsearchException::new);
|
|
|
this.searchResponse = in.readOptionalWriteable(SearchResponse::new);
|
|
|
this.isPartial = in.readBoolean();
|
|
@@ -92,7 +86,6 @@ public class AsyncSearchResponse extends ActionResponse implements StatusToXCont
|
|
|
@Override
|
|
|
public void writeTo(StreamOutput out) throws IOException {
|
|
|
out.writeOptionalString(id);
|
|
|
- out.writeVInt(version);
|
|
|
out.writeOptionalWriteable(error);
|
|
|
out.writeOptionalWriteable(searchResponse);
|
|
|
out.writeBoolean(isPartial);
|
|
@@ -102,7 +95,7 @@ public class AsyncSearchResponse extends ActionResponse implements StatusToXCont
|
|
|
}
|
|
|
|
|
|
public AsyncSearchResponse clone(String id) {
|
|
|
- return new AsyncSearchResponse(id, version, searchResponse, error, isPartial, false, startTimeMillis, expirationTimeMillis);
|
|
|
+ return new AsyncSearchResponse(id, searchResponse, error, isPartial, false, startTimeMillis, expirationTimeMillis);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -113,13 +106,6 @@ public class AsyncSearchResponse extends ActionResponse implements StatusToXCont
|
|
|
return id;
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * Returns the version of this response.
|
|
|
- */
|
|
|
- public int getVersion() {
|
|
|
- return version;
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* Returns the current {@link SearchResponse} or <code>null</code> if not available.
|
|
|
*
|
|
@@ -189,7 +175,6 @@ public class AsyncSearchResponse extends ActionResponse implements StatusToXCont
|
|
|
if (id != null) {
|
|
|
builder.field("id", id);
|
|
|
}
|
|
|
- builder.field("version", version);
|
|
|
builder.field("is_partial", isPartial);
|
|
|
builder.field("is_running", isRunning);
|
|
|
builder.field("start_time_in_millis", startTimeMillis);
|