Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the deprecated _termvector endpoint. #36131

Merged
merged 1 commit into from
Dec 3, 2018
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
3 changes: 0 additions & 3 deletions docs/reference/docs/termvectors.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ or by adding the requested fields in the request body (see
example below). Fields can also be specified with wildcards
in similar way to the <<query-dsl-multi-match-query,multi match query>>

[WARNING]
Note that the usage of `/_termvector` is deprecated in 2.0, and replaced by `/_termvectors`.

[float]
=== Return values

Expand Down
7 changes: 7 additions & 0 deletions docs/reference/migration/migrate_7_0/api.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,10 @@ while now an exception is thrown.

The deprecated graph endpoints (those with `/_graph/_explore`) have been
removed.


[float]
==== Deprecated `_termvector` endpoint removed

The `_termvector` endpoint was deprecated in 2.0 and has now been removed.
The endpoint `_termvectors` (plural) should be used instead.
8 changes: 7 additions & 1 deletion docs/reference/migration/migrate_7_0/java.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,10 @@ was moved to `org.elasticsearch.search.aggregations.PipelineAggregationBuilders`
==== `Retry.withBackoff` methods with `Settings` removed

The variants of `Retry.withBackoff` that included `Settings` have been removed
because `Settings` is no longer needed.
because `Settings` is no longer needed.

[float]
==== Deprecated method `Client#termVector` removed

The client method `termVector`, deprecated in 2.0, has been removed. The method
`termVectors` (plural) should be used instead.
33 changes: 0 additions & 33 deletions server/src/main/java/org/elasticsearch/client/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -370,39 +370,6 @@ public interface Client extends ElasticsearchClient, Releasable {
*/
TermVectorsRequestBuilder prepareTermVectors(String index, String type, String id);

/**
* An action that returns the term vectors for a specific document.
*
* @param request The term vector request
* @return The response future
*/
@Deprecated
ActionFuture<TermVectorsResponse> termVector(TermVectorsRequest request);

/**
* An action that returns the term vectors for a specific document.
*
* @param request The term vector request
*/
@Deprecated
void termVector(TermVectorsRequest request, ActionListener<TermVectorsResponse> listener);

/**
* Builder for the term vector request.
*/
@Deprecated
TermVectorsRequestBuilder prepareTermVector();

/**
* Builder for the term vector request.
*
* @param index The index to load the document from
* @param type The type of the document
* @param id The id of the document
*/
@Deprecated
TermVectorsRequestBuilder prepareTermVector(String index, String type, String id);

/**
* Multi get term vectors.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -581,30 +581,6 @@ public TermVectorsRequestBuilder prepareTermVectors(String index, String type, S
return new TermVectorsRequestBuilder(this, TermVectorsAction.INSTANCE, index, type, id);
}

@Deprecated
@Override
public ActionFuture<TermVectorsResponse> termVector(final TermVectorsRequest request) {
return termVectors(request);
}

@Deprecated
@Override
public void termVector(final TermVectorsRequest request, final ActionListener<TermVectorsResponse> listener) {
termVectors(request, listener);
}

@Deprecated
@Override
public TermVectorsRequestBuilder prepareTermVector() {
return prepareTermVectors();
}

@Deprecated
@Override
public TermVectorsRequestBuilder prepareTermVector(String index, String type, String id) {
return prepareTermVectors(index, type, id);
}

@Override
public ActionFuture<MultiTermVectorsResponse> multiTermVectors(final MultiTermVectorsRequest request) {
return execute(MultiTermVectorsAction.INSTANCE, request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@

package org.elasticsearch.rest.action.document;

import org.apache.logging.log4j.LogManager;
import org.elasticsearch.action.termvectors.TermVectorsRequest;
import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.logging.DeprecationLogger;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.index.VersionType;
Expand All @@ -45,19 +43,13 @@
* TermVectorsRequest.
*/
public class RestTermVectorsAction extends BaseRestHandler {
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(
LogManager.getLogger(RestTermVectorsAction.class));

public RestTermVectorsAction(Settings settings, RestController controller) {
super(settings);
controller.registerWithDeprecatedHandler(GET, "/{index}/{type}/_termvectors", this,
GET, "/{index}/{type}/_termvector", deprecationLogger);
controller.registerWithDeprecatedHandler(POST, "/{index}/{type}/_termvectors", this,
POST, "/{index}/{type}/_termvector", deprecationLogger);
controller.registerWithDeprecatedHandler(GET, "/{index}/{type}/{id}/_termvectors", this,
GET, "/{index}/{type}/{id}/_termvector", deprecationLogger);
controller.registerWithDeprecatedHandler(POST, "/{index}/{type}/{id}/_termvectors", this,
POST, "/{index}/{type}/{id}/_termvector", deprecationLogger);
controller.registerHandler(GET, "/{index}/{type}/_termvectors", this);
controller.registerHandler(POST, "/{index}/{type}/_termvectors", this);
controller.registerHandler(GET, "/{index}/{type}/{id}/_termvectors", this);
controller.registerHandler(POST, "/{index}/{type}/{id}/_termvectors", this);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ public void testDuelWithAndWithoutTermVectors() throws IOException, ExecutionExc
for (int id = 0; id < content.length; id++) {
Fields[] fields = new Fields[2];
for (int j = 0; j < indexNames.length; j++) {
TermVectorsResponse resp = client().prepareTermVector(indexNames[j], "type1", String.valueOf(id))
TermVectorsResponse resp = client().prepareTermVectors(indexNames[j], "type1", String.valueOf(id))
.setOffsets(true)
.setPositions(true)
.setSelectedFields("field1")
Expand Down Expand Up @@ -1069,7 +1069,7 @@ public void testWithKeywordAndNormalizer() throws IOException, ExecutionExceptio
for (int id = 0; id < content.length; id++) {
Fields[] fields = new Fields[2];
for (int j = 0; j < indexNames.length; j++) {
TermVectorsResponse resp = client().prepareTermVector(indexNames[j], "type1", String.valueOf(id))
TermVectorsResponse resp = client().prepareTermVectors(indexNames[j], "type1", String.valueOf(id))
.setOffsets(true)
.setPositions(true)
.setSelectedFields("field1", "field2")
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -492,13 +492,13 @@ private void assertUserExecutes(String user, String action, String index, boolea
assertAccessIsAllowed("admin", "GET", "/" + index + "/_search");
assertAccessIsAllowed("admin", "GET", "/" + index + "/foo/1");
assertAccessIsAllowed(user, "GET", "/" + index + "/foo/1/_explain", "{ \"query\" : { \"match_all\" : {} } }");
assertAccessIsAllowed(user, "GET", "/" + index + "/foo/1/_termvector");
assertAccessIsAllowed(user, "GET", "/" + index + "/foo/1/_termvectors");
assertUserIsAllowed(user, "search", index);
} else {
assertAccessIsDenied(user, "GET", "/" + index + "/_count");
assertAccessIsDenied(user, "GET", "/" + index + "/_search");
assertAccessIsDenied(user, "GET", "/" + index + "/foo/1/_explain", "{ \"query\" : { \"match_all\" : {} } }");
assertAccessIsDenied(user, "GET", "/" + index + "/foo/1/_termvector");
assertAccessIsDenied(user, "GET", "/" + index + "/foo/1/_termvectors");
assertUserIsDenied(user, "search", index);
}
break;
Expand Down