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

Deprecate types in termvector and mtermvector requests. #36182

Merged

Conversation

jtibshirani
Copy link
Contributor

@jtibshirani jtibshirani commented Dec 3, 2018

The following updates were made:

  • Add deprecation warnings to Rest*TermVectorsAction, plus tests in Rest*TermVectorsActionTests.
  • Deprecate relevant methods on the Java HLRC requests/ responses.
  • Update documentation (for both the REST API and Java HLRC).
  • For each REST yml test, create one version without types, and another legacy version that retains types (called *_with_types.yml).

I assumed here that we will be going with the endpoint format {index}/_termvectors/{id}, but we should hold off on merging this until we've reached a final consensus.

@jtibshirani jtibshirani added :Search Foundations/Mapping Index mappings, including merging and defining field types >deprecation v7.0.0 labels Dec 3, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search

@jtibshirani jtibshirani force-pushed the deprecate-types-in-termvectors branch from a6f9c4b to 9516344 Compare December 3, 2018 23:03
"ids" : ["testing_document"]

- match: {docs.0.term_vectors.text.terms.brown.term_freq: 2}
- match: {docs.0.term_vectors.text.terms.brown.ttf: 2}
Copy link
Contributor

@markharwood markharwood Dec 4, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the expected behaviour when docs are stored with a custom type but queried via a typeless api?
Not sure there's a test for that here? (Ignore me - I've just seen that overlaps with #35790 )

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 the tests in that PR should cover this case.

@@ -60,6 +63,8 @@
* required.
*/
public class TermVectorsRequest extends SingleShardRequest<TermVectorsRequest> implements RealtimeRequest {
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(
LogManager.getLogger(MultiTermVectorsRequest.class));

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cut-and-paste code has wrong class?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, thanks for catching this!

@@ -621,6 +626,7 @@ public static void parseRequest(TermVectorsRequest termVectorsRequest, XContentP
termVectorsRequest.index = parser.text();
} else if (TYPE.match(currentFieldName, parser.getDeprecationHandler())) {
termVectorsRequest.type = parser.text();
deprecationLogger.deprecated(RestMultiTermVectorsAction.TYPES_DEPRECATION_MESSAGE);
} else if (ID.match(currentFieldName, parser.getDeprecationHandler())) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cut-and-paste code with wrong message?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll update this too, as I think it's clearer to use RestTermVectorsAction here. I initially used the multi termvectors message because this method is also used in parsing multi termvector requests.

Copy link
Contributor

@jpountz jpountz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM minus the comment from Mark about the class used to instantiate a logger.

@markharwood
Copy link
Contributor

markharwood commented Dec 4, 2018

LGTM aside from logging comment and I see tests fail due to TermVectorsUnitTests missing a couple of assertWarnings

@jtibshirani
Copy link
Contributor Author

@elasticmachine run default distro tests

@jtibshirani
Copy link
Contributor Author

@elasticmachine run gradle build tests 2

@jtibshirani jtibshirani merged commit 3f3cde4 into elastic:master Dec 6, 2018
@jtibshirani jtibshirani deleted the deprecate-types-in-termvectors branch December 6, 2018 18:23
@jtibshirani jtibshirani changed the title Deprecate types in term vector requests. Deprecate types in termvector and mtermvector requests. Dec 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>deprecation :Search Foundations/Mapping Index mappings, including merging and defining field types v7.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants