Skip to content
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
6 changes: 6 additions & 0 deletions docs/reference/mapping/fields/type-field.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ PUT my_index/_doc/1?refresh=true
{
"text": "Document with type 'doc'"
}
--------------------------
// TESTSETUP

[source,console]
--------------------------
GET my_index/_search
{
"query": {
Expand Down Expand Up @@ -52,6 +56,8 @@ GET my_index/_search
}

--------------------------
// TEST[warning:[types removal] Using the _type field in queries and aggregations is deprecated, prefer to use a field instead.]
// TEST[warning:[types removal] Looking up doc types [_type] in scripts is deprecated.]

<1> Querying on the `_type` field
<2> Aggregating on the `_type` field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ teardown:
"docs": [
{
"_index": "index",
"_type": "type",
"_id": "id",
"_source": {
"field": "abc2xyz"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,6 @@
"docs": [
{
"_index": "index",
"_type": "type",
"_id": "id",
"_source": {
"foo": "bar"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

package org.elasticsearch.index.query;

import org.apache.logging.log4j.LogManager;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.index.Fields;
import org.apache.lucene.search.BooleanClause;
Expand All @@ -43,7 +42,6 @@
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.io.stream.Writeable;
import org.elasticsearch.common.logging.DeprecationLogger;
import org.elasticsearch.common.lucene.search.MoreLikeThisQuery;
import org.elasticsearch.common.lucene.search.XMoreLikeThis;
import org.elasticsearch.common.lucene.uid.Versions;
Expand Down Expand Up @@ -79,11 +77,6 @@
*/
public class MoreLikeThisQueryBuilder extends AbstractQueryBuilder<MoreLikeThisQueryBuilder> {
public static final String NAME = "more_like_this";
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(
LogManager.getLogger(MoreLikeThisQueryBuilder.class));
static final String TYPES_DEPRECATION_MESSAGE = "[types removal] Types are deprecated in [more_like_this] " +
"queries. The type should no longer be specified in the [like] and [unlike] sections.";


public static final int DEFAULT_MAX_QUERY_TERMS = XMoreLikeThis.DEFAULT_MAX_QUERY_TERMS;
public static final int DEFAULT_MIN_TERM_FREQ = XMoreLikeThis.DEFAULT_MIN_TERM_FREQ;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,11 +292,8 @@ void checkWarningHeaders(final List<String> warningHeaders, final Version master
final boolean matches = matcher.matches();
if (matches) {
final String message = matcher.group(1);
if (message.startsWith("[types removal]") || message.startsWith("[_data_frame/transforms/] is deprecated")) {
/*
* We skip warnings related to types deprecation and transform rename so that we can continue to run the many
* mixed-version tests that used typed APIs.
*/
if (message.startsWith("[_data_frame/transforms/] is deprecated")) {
// We skip warnings related to the transform rename so that we can continue to run the many mixed-version tests.
} else if (expected.remove(message) == false) {
unexpected.add(header);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,16 +128,6 @@ public void testWarningHeaders() {
}
}

public void testIgnoreTypesWarnings() {
String legitimateWarning = DeprecationLogger.formatWarning("warning");
String typesWarning = DeprecationLogger.formatWarning("[types removal] " +
"The endpoint /{index}/{type}/_count is deprecated, use /{index}/_count instead.");

DoSection section = new DoSection(new XContentLocation(1, 1));
section.setExpectedWarningHeaders(singletonList("warning"));
section.checkWarningHeaders(Arrays.asList(legitimateWarning, typesWarning), Version.CURRENT);
}

public void testParseDoSectionNoBody() throws Exception {
parser = createParser(YamlXContent.yamlXContent,
"get:\n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@
public class ShapeQueryBuilder extends AbstractGeometryQueryBuilder<ShapeQueryBuilder> {
public static final String NAME = "shape";

static final String TYPES_DEPRECATION_MESSAGE = "[types removal] Types are deprecated in [geo_shape] queries. " +
"The type should no longer be specified in the [indexed_shape] section.";

/**
* Creates a new GeoShapeQueryBuilder whose Query will be against the given
* field name using the given Shape
Expand Down