diff --git a/modules/parent-join/src/test/java/org/elasticsearch/join/query/HasParentQueryBuilderTests.java b/modules/parent-join/src/test/java/org/elasticsearch/join/query/HasParentQueryBuilderTests.java index 4e9770f62181b..88176cd0f39fc 100644 --- a/modules/parent-join/src/test/java/org/elasticsearch/join/query/HasParentQueryBuilderTests.java +++ b/modules/parent-join/src/test/java/org/elasticsearch/join/query/HasParentQueryBuilderTests.java @@ -193,8 +193,7 @@ public void testFromJson() throws IOException { "query" : { "term" : { "tag" : { - "value" : "something", - "boost" : 1.0 + "value" : "something" } } }, @@ -218,8 +217,7 @@ public void testParseDefaultsRemoved() throws IOException { "query" : { "term" : { "tag" : { - "value" : "something", - "boost" : 1.0 + "value" : "something" } } }, @@ -235,8 +233,7 @@ public void testParseDefaultsRemoved() throws IOException { "query" : { "term" : { "tag" : { - "value" : "something", - "boost" : 1.0 + "value" : "something" } } }, diff --git a/rest-api-spec/build.gradle b/rest-api-spec/build.gradle index 3c938021af26e..3dd293732b379 100644 --- a/rest-api-spec/build.gradle +++ b/rest-api-spec/build.gradle @@ -1,5 +1,4 @@ import org.elasticsearch.gradle.Version -import org.elasticsearch.gradle.internal.info.BuildParams apply plugin: 'elasticsearch.build' apply plugin: 'elasticsearch.publish' @@ -76,6 +75,7 @@ tasks.named("yamlRestTestV7CompatTransform").configure { task -> task.skipTest("search/340_type_query/type query", "#47207 type query throws exception in compatible mode") task.skipTest("search.aggregation/210_top_hits_nested_metric/top_hits aggregation with sequence numbers", "#42809 the use nested path and filter sort throws an exception") task.skipTest("search/310_match_bool_prefix/multi_match multiple fields with cutoff_frequency throws exception", "#42654 cutoff_frequency, common terms are not supported. Throwing an exception") + task.skipTest("search_shards/10_basic/Search shards aliases with and without filters", "Filter representation no longer outputs default boosts") task.skipTest("search.aggregation/20_terms/string profiler via global ordinals filters implementation", "The profiler results aren't backwards compatible.") task.skipTest("search.aggregation/20_terms/string profiler via global ordinals native implementation", "The profiler results aren't backwards compatible.") task.skipTest("search.aggregation/20_terms/string profiler via map", "The profiler results aren't backwards compatible.") diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search_shards/10_basic.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search_shards/10_basic.yml index c89873f2b2c6f..cd884c0ab3a50 100644 --- a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search_shards/10_basic.yml +++ b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search_shards/10_basic.yml @@ -54,8 +54,6 @@ - match: { shards.0.0.index: test_index } - match: { indices.test_index.aliases: [test_alias_filter_1] } - match: { indices.test_index.filter.term.field.value: value1 } - - lte: { indices.test_index.filter.term.field.boost: 1.0 } - - gte: { indices.test_index.filter.term.field.boost: 1.0 } - do: search_shards: @@ -65,12 +63,6 @@ - match: { shards.0.0.index: test_index } - match: { indices.test_index.aliases: [test_alias_filter_1, test_alias_filter_2]} - length: { indices.test_index.filter.bool.should: 2 } - - lte: { indices.test_index.filter.bool.should.0.term.field.boost: 1.0 } - - gte: { indices.test_index.filter.bool.should.0.term.field.boost: 1.0 } - - lte: { indices.test_index.filter.bool.should.1.term.field.boost: 1.0 } - - gte: { indices.test_index.filter.bool.should.1.term.field.boost: 1.0 } - - lte: { indices.test_index.filter.bool.boost: 1.0 } - - gte: { indices.test_index.filter.bool.boost: 1.0 } - do: search_shards: diff --git a/server/src/internalClusterTest/java/org/elasticsearch/aliases/IndexAliasesIT.java b/server/src/internalClusterTest/java/org/elasticsearch/aliases/IndexAliasesIT.java index cb5a064c5e262..6e00502785a90 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/aliases/IndexAliasesIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/aliases/IndexAliasesIT.java @@ -213,7 +213,7 @@ public void testFilteringAliases() throws Exception { ClusterState clusterState = admin().cluster().prepareState().get().getState(); IndexMetadata indexMd = clusterState.metadata().index("test"); assertThat(indexMd.getAliases().get("alias1").filter().string(), equalTo(""" - {"term":{"user":{"value":"kimchy","boost":1.0}}}""")); + {"term":{"user":{"value":"kimchy"}}}""")); } @@ -799,7 +799,7 @@ public void testSameAlias() { IndexAbstraction ia = metadata.getIndicesLookup().get("alias1"); AliasMetadata aliasMetadata = AliasMetadata.getFirstAliasMetadata(metadata, ia); assertThat(aliasMetadata.getFilter().toString(), equalTo(""" - {"term":{"name":{"value":"bar","boost":1.0}}}""")); + {"term":{"name":{"value":"bar"}}}""")); logger.info("--> deleting alias1"); stopWatch.start(); diff --git a/server/src/main/java/org/elasticsearch/index/query/BaseTermQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/BaseTermQueryBuilder.java index f0c3772ec47c5..91ab807214fa2 100644 --- a/server/src/main/java/org/elasticsearch/index/query/BaseTermQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/BaseTermQueryBuilder.java @@ -142,7 +142,7 @@ protected void doXContent(XContentBuilder builder, Params params) throws IOExcep builder.startObject(fieldName); builder.field(VALUE_FIELD.getPreferredName(), maybeConvertToString(this.value)); addExtraXContent(builder, params); - printBoostAndQueryName(builder); + boostAndQueryNameToXContent(builder); builder.endObject(); builder.endObject(); } diff --git a/server/src/main/java/org/elasticsearch/index/query/FieldMaskingSpanQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/FieldMaskingSpanQueryBuilder.java index 19a19dd9b3a1f..dcb2e2d3e09ea 100644 --- a/server/src/main/java/org/elasticsearch/index/query/FieldMaskingSpanQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/FieldMaskingSpanQueryBuilder.java @@ -88,7 +88,7 @@ protected void doXContent(XContentBuilder builder, Params params) throws IOExcep builder.field(QUERY_FIELD.getPreferredName()); queryBuilder.toXContent(builder, params); builder.field(FIELD_FIELD.getPreferredName(), fieldName); - printBoostAndQueryName(builder); + boostAndQueryNameToXContent(builder); builder.endObject(); } diff --git a/server/src/main/java/org/elasticsearch/index/query/SpanContainingQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/SpanContainingQueryBuilder.java index 4095c96829e1f..72d94a60b2d32 100644 --- a/server/src/main/java/org/elasticsearch/index/query/SpanContainingQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/SpanContainingQueryBuilder.java @@ -87,7 +87,7 @@ protected void doXContent(XContentBuilder builder, Params params) throws IOExcep big.toXContent(builder, params); builder.field(LITTLE_FIELD.getPreferredName()); little.toXContent(builder, params); - printBoostAndQueryName(builder); + boostAndQueryNameToXContent(builder); builder.endObject(); } diff --git a/server/src/main/java/org/elasticsearch/index/query/SpanFirstQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/SpanFirstQueryBuilder.java index 056bbb75af676..460ef50bd3dd7 100644 --- a/server/src/main/java/org/elasticsearch/index/query/SpanFirstQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/SpanFirstQueryBuilder.java @@ -87,7 +87,7 @@ protected void doXContent(XContentBuilder builder, Params params) throws IOExcep builder.field(MATCH_FIELD.getPreferredName()); matchBuilder.toXContent(builder, params); builder.field(END_FIELD.getPreferredName(), end); - printBoostAndQueryName(builder); + boostAndQueryNameToXContent(builder); builder.endObject(); } diff --git a/server/src/main/java/org/elasticsearch/index/query/SpanMultiTermQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/SpanMultiTermQueryBuilder.java index c87a87e25650d..e2bd8c88f9676 100644 --- a/server/src/main/java/org/elasticsearch/index/query/SpanMultiTermQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/SpanMultiTermQueryBuilder.java @@ -69,7 +69,7 @@ protected void doXContent(XContentBuilder builder, Params params) throws IOExcep builder.startObject(NAME); builder.field(MATCH_FIELD.getPreferredName()); multiTermQueryBuilder.toXContent(builder, params); - printBoostAndQueryName(builder); + boostAndQueryNameToXContent(builder); builder.endObject(); } diff --git a/server/src/main/java/org/elasticsearch/index/query/SpanNearQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/SpanNearQueryBuilder.java index d6cf1dacfcb5b..9b9a772af7a25 100644 --- a/server/src/main/java/org/elasticsearch/index/query/SpanNearQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/SpanNearQueryBuilder.java @@ -136,7 +136,7 @@ protected void doXContent(XContentBuilder builder, Params params) throws IOExcep builder.endArray(); builder.field(SLOP_FIELD.getPreferredName(), slop); builder.field(IN_ORDER_FIELD.getPreferredName(), inOrder); - printBoostAndQueryName(builder); + boostAndQueryNameToXContent(builder); builder.endObject(); } diff --git a/server/src/main/java/org/elasticsearch/index/query/SpanNotQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/SpanNotQueryBuilder.java index 756e6170ae6d5..befca7fd87df2 100644 --- a/server/src/main/java/org/elasticsearch/index/query/SpanNotQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/SpanNotQueryBuilder.java @@ -146,9 +146,13 @@ protected void doXContent(XContentBuilder builder, Params params) throws IOExcep include.toXContent(builder, params); builder.field(EXCLUDE_FIELD.getPreferredName()); exclude.toXContent(builder, params); - builder.field(PRE_FIELD.getPreferredName(), pre); - builder.field(POST_FIELD.getPreferredName(), post); - printBoostAndQueryName(builder); + if (pre != DEFAULT_PRE) { + builder.field(PRE_FIELD.getPreferredName(), pre); + } + if (post != DEFAULT_POST) { + builder.field(POST_FIELD.getPreferredName(), post); + } + boostAndQueryNameToXContent(builder); builder.endObject(); } diff --git a/server/src/main/java/org/elasticsearch/index/query/SpanOrQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/SpanOrQueryBuilder.java index a204007ae3d2d..cf1738dddecca 100644 --- a/server/src/main/java/org/elasticsearch/index/query/SpanOrQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/SpanOrQueryBuilder.java @@ -85,7 +85,7 @@ protected void doXContent(XContentBuilder builder, Params params) throws IOExcep clause.toXContent(builder, params); } builder.endArray(); - printBoostAndQueryName(builder); + boostAndQueryNameToXContent(builder); builder.endObject(); } diff --git a/server/src/main/java/org/elasticsearch/index/query/SpanWithinQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/SpanWithinQueryBuilder.java index b70c97c8d0521..1187b17714802 100644 --- a/server/src/main/java/org/elasticsearch/index/query/SpanWithinQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/SpanWithinQueryBuilder.java @@ -91,7 +91,7 @@ protected void doXContent(XContentBuilder builder, Params params) throws IOExcep builder.field(LITTLE_FIELD.getPreferredName()); little.toXContent(builder, params); - printBoostAndQueryName(builder); + boostAndQueryNameToXContent(builder); builder.endObject(); } diff --git a/server/src/test/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesRequestTests.java b/server/src/test/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesRequestTests.java index eab18d96c2bf7..2f94d8cd8e3f4 100644 --- a/server/src/test/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesRequestTests.java +++ b/server/src/test/java/org/elasticsearch/action/fieldcaps/FieldCapabilitiesRequestTests.java @@ -134,8 +134,7 @@ public void testToXContent() throws IOException { { "index_filter": { "term": { "field": { - "value": "value", - "boost": 1.0 + "value": "value" } } }, diff --git a/server/src/test/java/org/elasticsearch/index/query/BoolQueryBuilderTests.java b/server/src/test/java/org/elasticsearch/index/query/BoolQueryBuilderTests.java index bd3e5f53b6239..7827d4c93816d 100644 --- a/server/src/test/java/org/elasticsearch/index/query/BoolQueryBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/index/query/BoolQueryBuilderTests.java @@ -216,16 +216,14 @@ public void testFromJson() throws IOException { + " \"must\" : [ {" + " \"term\" : {" + " \"user\" : {" - + " \"value\" : \"kimchy\"," - + " \"boost\" : 1.0" + + " \"value\" : \"kimchy\"" + " }" + " }" + " } ]," + " \"filter\" : [ {" + " \"term\" : {" + " \"tag\" : {" - + " \"value\" : \"tech\"," - + " \"boost\" : 1.0" + + " \"value\" : \"tech\"" + " }" + " }" + " } ]," @@ -241,15 +239,13 @@ public void testFromJson() throws IOException { + " \"should\" : [ {" + " \"term\" : {" + " \"tag\" : {" - + " \"value\" : \"wow\"," - + " \"boost\" : 1.0" + + " \"value\" : \"wow\"" + " }" + " }" + " }, {" + " \"term\" : {" + " \"tag\" : {" - + " \"value\" : \"elasticsearch\"," - + " \"boost\" : 1.0" + + " \"value\" : \"elasticsearch\"" + " }" + " }" + " } ]," diff --git a/server/src/test/java/org/elasticsearch/index/query/DisMaxQueryBuilderTests.java b/server/src/test/java/org/elasticsearch/index/query/DisMaxQueryBuilderTests.java index eef4d2fcfa1ae..6fabadedf1ee4 100644 --- a/server/src/test/java/org/elasticsearch/index/query/DisMaxQueryBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/index/query/DisMaxQueryBuilderTests.java @@ -95,15 +95,13 @@ public void testFromJson() throws IOException { "queries" : [ { "term" : { "age" : { - "value" : 34, - "boost" : 1.0 + "value" : 34 } } }, { "term" : { "age" : { - "value" : 35, - "boost" : 1.0 + "value" : 35 } } } ], diff --git a/server/src/test/java/org/elasticsearch/index/query/SpanContainingQueryBuilderTests.java b/server/src/test/java/org/elasticsearch/index/query/SpanContainingQueryBuilderTests.java index 6378d1d2b2d6c..9647de83b178a 100644 --- a/server/src/test/java/org/elasticsearch/index/query/SpanContainingQueryBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/index/query/SpanContainingQueryBuilderTests.java @@ -45,28 +45,24 @@ public void testFromJson() throws IOException { "clauses" : [ { "span_term" : { "field1" : { - "value" : "bar", - "boost" : 1.0 + "value" : "bar" } } }, { "span_term" : { "field1" : { - "value" : "baz", - "boost" : 1.0 + "value" : "baz" } } } ], "slop" : 5, - "in_order" : true, - "boost" : 1.0 + "in_order" : true } }, "little" : { "span_term" : { "field1" : { - "value" : "foo", - "boost" : 1.0 + "value" : "foo" } } }, diff --git a/server/src/test/java/org/elasticsearch/index/query/SpanFirstQueryBuilderTests.java b/server/src/test/java/org/elasticsearch/index/query/SpanFirstQueryBuilderTests.java index 11fc2835f1782..bff301f2b7ba3 100644 --- a/server/src/test/java/org/elasticsearch/index/query/SpanFirstQueryBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/index/query/SpanFirstQueryBuilderTests.java @@ -70,13 +70,11 @@ public void testFromJson() throws IOException { "match" : { "span_term" : { "user" : { - "value" : "kimchy", - "boost" : 1.0 + "value" : "kimchy" } } }, - "end" : 3, - "boost" : 1.0 + "end" : 3 } }"""; diff --git a/server/src/test/java/org/elasticsearch/index/query/SpanGapQueryBuilderTests.java b/server/src/test/java/org/elasticsearch/index/query/SpanGapQueryBuilderTests.java index 315ce2bcfbade..191ffe0f4231d 100644 --- a/server/src/test/java/org/elasticsearch/index/query/SpanGapQueryBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/index/query/SpanGapQueryBuilderTests.java @@ -79,8 +79,7 @@ public void testFromJson() throws IOException { "clauses" : [ { "span_term" : { "field" : { - "value" : "value1", - "boost" : 1.0 + "value" : "value1" } } }, { @@ -89,14 +88,12 @@ public void testFromJson() throws IOException { }, { "span_term" : { "field" : { - "value" : "value3", - "boost" : 1.0 + "value" : "value3" } } } ], "slop" : 12, - "in_order" : false, - "boost" : 1.0 + "in_order" : false } }"""; diff --git a/server/src/test/java/org/elasticsearch/index/query/SpanMultiTermQueryBuilderTests.java b/server/src/test/java/org/elasticsearch/index/query/SpanMultiTermQueryBuilderTests.java index 42a498ad184d4..3cb1813199da7 100644 --- a/server/src/test/java/org/elasticsearch/index/query/SpanMultiTermQueryBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/index/query/SpanMultiTermQueryBuilderTests.java @@ -234,8 +234,7 @@ public void testFromJson() throws IOException { "boost" : 1.08 } } - }, - "boost" : 1.0 + } } }"""; diff --git a/server/src/test/java/org/elasticsearch/index/query/SpanNearQueryBuilderTests.java b/server/src/test/java/org/elasticsearch/index/query/SpanNearQueryBuilderTests.java index eff8e37fa8709..2aa280edd3a56 100644 --- a/server/src/test/java/org/elasticsearch/index/query/SpanNearQueryBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/index/query/SpanNearQueryBuilderTests.java @@ -82,22 +82,19 @@ public void testFromJson() throws IOException { "clauses" : [ { "span_term" : { "field" : { - "value" : "value1", - "boost" : 1.0 + "value" : "value1" } } }, { "span_term" : { "field" : { - "value" : "value2", - "boost" : 1.0 + "value" : "value2" } } }, { "span_term" : { "field" : { - "value" : "value3", - "boost" : 1.0 + "value" : "value3" } } } ], diff --git a/server/src/test/java/org/elasticsearch/index/query/SpanNotQueryBuilderTests.java b/server/src/test/java/org/elasticsearch/index/query/SpanNotQueryBuilderTests.java index a1426d3783fe3..fc325a0ebe171 100644 --- a/server/src/test/java/org/elasticsearch/index/query/SpanNotQueryBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/index/query/SpanNotQueryBuilderTests.java @@ -168,8 +168,7 @@ public void testFromJson() throws IOException { "include" : { "span_term" : { "field1" : { - "value" : "hoya", - "boost" : 1.0 + "value" : "hoya" } } }, @@ -178,25 +177,20 @@ public void testFromJson() throws IOException { "clauses" : [ { "span_term" : { "field1" : { - "value" : "la", - "boost" : 1.0 + "value" : "la" } } }, { "span_term" : { "field1" : { - "value" : "hoya", - "boost" : 1.0 + "value" : "hoya" } } } ], "slop" : 0, - "in_order" : true, - "boost" : 1.0 + "in_order" : true } }, - "pre" : 0, - "post" : 0, "boost" : 2.0 } }"""; diff --git a/server/src/test/java/org/elasticsearch/index/query/SpanOrQueryBuilderTests.java b/server/src/test/java/org/elasticsearch/index/query/SpanOrQueryBuilderTests.java index 6390dde48cdad..087852bb370ef 100644 --- a/server/src/test/java/org/elasticsearch/index/query/SpanOrQueryBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/index/query/SpanOrQueryBuilderTests.java @@ -66,22 +66,19 @@ public void testFromJson() throws IOException { "clauses" : [ { "span_term" : { "field" : { - "value" : "value1", - "boost" : 1.0 + "value" : "value1" } } }, { "span_term" : { "field" : { - "value" : "value2", - "boost" : 1.0 + "value" : "value2" } } }, { "span_term" : { "field" : { - "value" : "value3", - "boost" : 1.0 + "value" : "value3" } } } ], diff --git a/server/src/test/java/org/elasticsearch/index/query/SpanWithinQueryBuilderTests.java b/server/src/test/java/org/elasticsearch/index/query/SpanWithinQueryBuilderTests.java index b3f08b5436914..ce7bb1748135a 100644 --- a/server/src/test/java/org/elasticsearch/index/query/SpanWithinQueryBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/index/query/SpanWithinQueryBuilderTests.java @@ -45,28 +45,24 @@ public void testFromJson() throws IOException { "clauses" : [ { "span_term" : { "field1" : { - "value" : "bar", - "boost" : 1.0 + "value" : "bar" } } }, { "span_term" : { "field1" : { - "value" : "baz", - "boost" : 1.0 + "value" : "baz" } } } ], "slop" : 5, - "in_order" : true, - "boost" : 1.0 + "in_order" : true } }, "little" : { "span_term" : { "field1" : { - "value" : "foo", - "boost" : 1.0 + "value" : "foo" } } }, diff --git a/server/src/test/java/org/elasticsearch/index/query/TermQueryBuilderTests.java b/server/src/test/java/org/elasticsearch/index/query/TermQueryBuilderTests.java index 422823cb08f0c..ea1f9c6160cb0 100644 --- a/server/src/test/java/org/elasticsearch/index/query/TermQueryBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/index/query/TermQueryBuilderTests.java @@ -127,8 +127,7 @@ public void testFromJson() throws IOException { "term" : { "exact_value" : { "value" : "Quick Foxes!", - "case_insensitive" : true, - "boost" : 1.0 + "case_insensitive" : true } } }"""; diff --git a/x-pack/plugin/async-search/src/test/java/org/elasticsearch/xpack/search/AsyncSearchTaskTests.java b/x-pack/plugin/async-search/src/test/java/org/elasticsearch/xpack/search/AsyncSearchTaskTests.java index e6f1900d3135a..2ef338e5f8982 100644 --- a/x-pack/plugin/async-search/src/test/java/org/elasticsearch/xpack/search/AsyncSearchTaskTests.java +++ b/x-pack/plugin/async-search/src/test/java/org/elasticsearch/xpack/search/AsyncSearchTaskTests.java @@ -107,7 +107,7 @@ public void testTaskDescription() { ); assertEquals(""" async_search{indices[index1,index2], search_type[QUERY_THEN_FETCH], source\ - [{"query":{"term":{"field":{"value":"value","boost":1.0}}}}]}""", asyncSearchTask.getDescription()); + [{"query":{"term":{"field":{"value":"value"}}}}]}""", asyncSearchTask.getDescription()); } public void testWaitForInit() throws InterruptedException { diff --git a/x-pack/plugin/eql/src/test/resources/querytranslator_tests.txt b/x-pack/plugin/eql/src/test/resources/querytranslator_tests.txt index 5c6187b4f4271..676266262be53 100644 --- a/x-pack/plugin/eql/src/test/resources/querytranslator_tests.txt +++ b/x-pack/plugin/eql/src/test/resources/querytranslator_tests.txt @@ -28,7 +28,7 @@ process where true singleNumericFilterEquals process where serial_event_id == 1 ; -contains "term":{"serial_event_id":{"value":1,"boost":1.0} +contains "term":{"serial_event_id":{"value":1} ; singleNumericFilterLess @@ -58,7 +58,7 @@ process where serial_event_id >= 4 caseInsensitiveEquals process where process_name : "test" ; -"term":{"process_name":{"value":"test","case_insensitive":true,"boost":1.0} +"term":{"process_name":{"value":"test","case_insensitive":true} ; caseInsensitiveEqualsWithPattern @@ -70,15 +70,15 @@ process where process_name : "test*" caseInsensitiveEqualsListSingleValue process where process_name : ("test") ; -"term":{"process_name":{"value":"test","case_insensitive":true,"boost":1.0} +"term":{"process_name":{"value":"test","case_insensitive":true} ; caseInsensitiveEqualsList process where process_name : ("test", "best") ; {"bool":{"should":[{"term" -"term":{"process_name":{"value":"test","case_insensitive":true,"boost":1.0} -"term":{"process_name":{"value":"best","case_insensitive":true,"boost":1.0} +"term":{"process_name":{"value":"test","case_insensitive":true} +"term":{"process_name":{"value":"best","case_insensitive":true} ; caseInsensitiveEqualsListWildcard @@ -86,13 +86,13 @@ process where process_name : ("test*", "best") ; {"bool":{"should":[{"wildcard" "wildcard":{"process_name":{"wildcard":"test*","case_insensitive":true,"boost":1.0} -"term":{"process_name":{"value":"best","case_insensitive":true,"boost":1.0} +"term":{"process_name":{"value":"best","case_insensitive":true} ; mixedTypeFilter process where process_name : "notepad.exe" or (serial_event_id < 4.5 and serial_event_id >= 3.1) ; -"term":{"process_name":{"value":"notepad.exe","case_insensitive":true,"boost":1.0} +"term":{"process_name":{"value":"notepad.exe","case_insensitive":true} {"bool":{"must":[{"range":{"serial_event_id":{"lt":4.5 {"range":{"serial_event_id":{"gte":3.1 ; @@ -147,23 +147,23 @@ process where process_path : "*\\red_ttp\\wininit.*" and opcode in (0,1,2,3) inFilterInsensitive process where process_name in~ ("test") ; -"term":{"process_name":{"value":"test","case_insensitive":true,"boost":1.0} +"term":{"process_name":{"value":"test","case_insensitive":true} ; inFilterInsensitiveList process where process_name in~ ("test", "best") ; {"bool":{"should":[{"term" -"term":{"process_name":{"value":"test","case_insensitive":true,"boost":1.0} -"term":{"process_name":{"value":"best","case_insensitive":true,"boost":1.0} +"term":{"process_name":{"value":"test","case_insensitive":true} +"term":{"process_name":{"value":"best","case_insensitive":true} ; inFilterInsensitiveVerbatimMatch process where process_name in~ ("test*", "best") ; {"bool":{"should":[{"term" -"term":{"process_name":{"value":"test*","case_insensitive":true,"boost":1.0} -"term":{"process_name":{"value":"best","case_insensitive":true,"boost":1.0} +"term":{"process_name":{"value":"test*","case_insensitive":true} +"term":{"process_name":{"value":"best","case_insensitive":true} ; inFilterInsensitiveWithScripting @@ -179,28 +179,28 @@ process where substring(command_line, 5) in~ ("test*", "best") functionEqualsTrue process where cidrMatch(source_address, "10.0.0.0/8") == true ; -{"bool":{"must":[{"term":{"event.category":{"value":"process","boost":1.0} +{"bool":{"must":[{"term":{"event.category":{"value":"process"} {"terms":{"source_address":["10.0.0.0/8"] ; functionEqualsFalse process where cidrMatch(source_address, "10.0.0.0/8") == false ; -{"bool":{"must":[{"term":{"event.category":{"value":"process","boost":1.0} +{"bool":{"must":[{"term":{"event.category":{"value":"process"} {"bool":{"must_not":[{"terms":{"source_address":["10.0.0.0/8"] ; functionNotEqualsTrue process where cidrMatch(source_address, "10.0.0.0/8") != true ; -{"bool":{"must":[{"term":{"event.category":{"value":"process","boost":1.0} +{"bool":{"must":[{"term":{"event.category":{"value":"process"} {"bool":{"must_not":[{"terms":{"source_address":["10.0.0.0/8"] ; functionNotEqualsFalse process where cidrMatch(source_address, "10.0.0.0/8") != false ; -{"bool":{"must":[{"term":{"event.category":{"value":"process","boost":1.0} +{"bool":{"must":[{"term":{"event.category":{"value":"process"} {"terms":{"source_address":["10.0.0.0/8"] ; @@ -221,21 +221,21 @@ process where endsWith~(process_path, "x") == true and endsWith~(process_path, " endsWithKeywordFieldFunction-caseSensitive process where endsWith(user_name, "c") ; -{"bool":{"must":[{"term":{"event.category":{"value":"process","boost":1.0}}}, +{"bool":{"must":[{"term":{"event.category":{"value":"process"}}}, {"wildcard":{"user_name":{"wildcard":"*c","boost":1.0}}}],"boost":1.0}} ; endsWithWildcardSubFieldFunction-caseSensitive process where endsWith(hostname, "c") ; -{"bool":{"must":[{"term":{"event.category":{"value":"process","boost":1.0}}}, +{"bool":{"must":[{"term":{"event.category":{"value":"process"}}}, {"wildcard":{"hostname.keyword":{"wildcard":"*c","boost":1.0}}}],"boost":1.0}} ; endsWithFunction-insensitive process where endsWith~(user_name, "c") ; -{"bool":{"must":[{"term":{"event.category":{"value":"process","boost":1.0}}}, +{"bool":{"must":[{"term":{"event.category":{"value":"process"}}}, {"wildcard":{"user_name":{"wildcard":"*c","case_insensitive":true,"boost":1.0}}}],"boost":1.0}} ; @@ -243,14 +243,14 @@ fieldNoEquals process where bool ; {"bool":{"must":[ -{"term":{"bool":{"value":true, +{"term":{"bool":{"value":true ; fieldNoEqualsInExpression process where length(file_name) > 0 and bool ; {"bool":{"must":[ -{"term":{"bool":{"value":true, +{"term":{"bool":{"value":true ; @@ -258,7 +258,7 @@ fieldEqualsTrue process where bool == true ; {"bool":{"must":[ -{"term":{"bool":{"value":true, +{"term":{"bool":{"value":true ; fieldEqualsFalse @@ -309,21 +309,21 @@ X0->InternalQlScriptUtils.nullSafeFilter(InternalQlScriptUtils.lt(InternalEqlScr startsWithFunction-insensitive process where startswith~(user_name, "A") ; -{"bool":{"must":[{"term":{"event.category":{"value":"process","boost":1.0}}}, +{"bool":{"must":[{"term":{"event.category":{"value":"process"}}}, {"prefix":{"user_name":{"value":"A","case_insensitive":true,"boost":1.0}}}],"boost":1.0}} ; startsWithFunctionSimple-caseSensitive process where startsWith(user_name, "A") ; -{"bool":{"must":[{"term":{"event.category":{"value":"process","boost":1.0}}}, +{"bool":{"must":[{"term":{"event.category":{"value":"process"}}}, {"prefix":{"user_name":{"value":"A","boost":1.0}}}],"boost":1.0}} ; startsWithFunctionWithCondition-caseSensitive process where startsWith(user_name, "A") or startsWith(user_name, "B") ; -{"bool":{"must":[{"term":{"event.category":{"value":"process","boost":1.0}}}, +{"bool":{"must":[{"term":{"event.category":{"value":"process"}}}, {"bool":{"should":[{"prefix":{"user_name":{"value":"A","boost":1.0}}}, {"prefix":{"user_name":{"value":"B","boost":1.0}}}],"boost":1.0}}],"boost":1.0}} ; @@ -331,7 +331,7 @@ process where startsWith(user_name, "A") or startsWith(user_name, "B") startsWithFunctionWithCondition-insensitive process where startswith~(user_name, "A") or startswith~(user_name, "B") ; -{"bool":{"must":[{"term":{"event.category":{"value":"process","boost":1.0}}}, +{"bool":{"must":[{"term":{"event.category":{"value":"process"}}}, {"bool":{"should":[{"prefix":{"user_name":{"value":"A","case_insensitive":true,"boost":1.0}}}, {"prefix":{"user_name":{"value":"B","case_insensitive":true,"boost":1.0}}}],"boost":1.0}}],"boost":1.0}} ; @@ -339,35 +339,35 @@ process where startswith~(user_name, "A") or startswith~(user_name, "B") stringContainsExactField-caseSensitive process where stringContains(process_name, "foo") ; -{"bool":{"must":[{"term":{"event.category":{"value":"process","boost":1.0}}}, +{"bool":{"must":[{"term":{"event.category":{"value":"process"}}}, {"wildcard":{"process_name":{"wildcard":"*foo*","boost":1.0}}}],"boost":1.0}} ; stringContainsExactField-insensitive process where stringContains~(process_name, "foo") ; -{"bool":{"must":[{"term":{"event.category":{"value":"process","boost":1.0}}}, +{"bool":{"must":[{"term":{"event.category":{"value":"process"}}}, {"wildcard":{"process_name":{"wildcard":"*foo*","case_insensitive":true,"boost":1.0}}}],"boost":1.0}} ; stringContainsExactSubField-caseSensitive process where stringContains(hostname, "foo") ; -{"bool":{"must":[{"term":{"event.category":{"value":"process","boost":1.0}}}, +{"bool":{"must":[{"term":{"event.category":{"value":"process"}}}, {"wildcard":{"hostname.keyword":{"wildcard":"*foo*","boost":1.0}}}],"boost":1.0}} ; stringContains-insensitive process where stringContains~(process_name, "foo") ; -{"bool":{"must":[{"term":{"event.category":{"value":"process","boost":1.0}}}, +{"bool":{"must":[{"term":{"event.category":{"value":"process"}}}, {"wildcard":{"process_name":{"wildcard":"*foo*","case_insensitive":true,"boost":1.0}}}],"boost":1.0}} ; stringContains-caseSensitive process where stringContains(process_name, "foo") ; -{"bool":{"must":[{"term":{"event.category":{"value":"process","boost":1.0}}}, +{"bool":{"must":[{"term":{"event.category":{"value":"process"}}}, {"wildcard":{"process_name":{"wildcard":"*foo*","boost":1.0}}}],"boost":1.0}} ; @@ -428,35 +428,35 @@ process where concat(process_name, "::foo::", null, 1) : "net.exe::foo::1" cidrMatchFunctionOne process where cidrMatch(source_address, "10.0.0.0/8") ; -{"bool":{"must":[{"term":{"event.category":{"value":"process","boost":1.0} +{"bool":{"must":[{"term":{"event.category":{"value":"process"} {"terms":{"source_address":["10.0.0.0/8"] ; cidrMatchFunctionOneBool process where cidrMatch(source_address, "10.0.0.0/8") == true ; -{"bool":{"must":[{"term":{"event.category":{"value":"process","boost":1.0} +{"bool":{"must":[{"term":{"event.category":{"value":"process"} {"terms":{"source_address":["10.0.0.0/8"] ; cidrMatchFunctionTwo process where cidrMatch(source_address, "10.0.0.0/8", "192.168.0.0/16") ; -{"bool":{"must":[{"term":{"event.category":{"value":"process","boost":1.0} +{"bool":{"must":[{"term":{"event.category":{"value":"process"} {"terms":{"source_address":["10.0.0.0/8","192.168.0.0/16"] ; cidrMatchFunctionTwoWithOr process where cidrMatch(source_address, "10.0.0.0/8") or cidrMatch(source_address, "192.168.0.0/16") ; -{"bool":{"must":[{"term":{"event.category":{"value":"process","boost":1.0} +{"bool":{"must":[{"term":{"event.category":{"value":"process"} {"bool":{"should":[{"terms":{"source_address":["10.0.0.0/8"],"boost":1.0}},{"terms":{"source_address":["192.168.0.0/16"],"boost":1.0}} ; cidrMatchFunctionThree process where cidrMatch(source_address, "10.0.0.0/8", "192.168.0.0/16", "2001:db8::/32") ; -{"bool":{"must":[{"term":{"event.category":{"value":"process","boost":1.0} +{"bool":{"must":[{"term":{"event.category":{"value":"process"} {"terms":{"source_address":["10.0.0.0/8","192.168.0.0/16","2001:db8::/32"] ; @@ -491,13 +491,13 @@ process where number(process_name, 16) != null numberFunctionFoldedComparison process where serial_event_id == number("-32.5") ; -{"term":{"serial_event_id":{"value":-32.5,"boost":1.0} +{"term":{"serial_event_id":{"value":-32.5} ; numberFunctionFoldedHexComparison process where serial_event_id == number("0x32", 16) ; -{"term":{"serial_event_id":{"value":50,"boost":1.0} +{"term":{"serial_event_id":{"value":50} ; @@ -693,13 +693,13 @@ process where true | tail 10 | head 7 likeSingleArgNoPattern process where command_line like "net.exe" ; -"term":{"command_line":{"value":"net.exe","boost":1.0} +"term":{"command_line":{"value":"net.exe"} ; likeSingleArgNoPatternInsensitive process where command_line like~ "net.exe" ; -"term":{"command_line":{"value":"net.exe","case_insensitive":true,"boost":1.0} +"term":{"command_line":{"value":"net.exe","case_insensitive":true} ; likeSingleArg @@ -751,13 +751,13 @@ process where substring(command_line, 5) like~ ("net.e*", "net.e?e") regexSingleArgNoPattern process where command_line regex "net\\.exe" ; -"term":{"command_line":{"value":"net.exe","boost":1.0} +"term":{"command_line":{"value":"net.exe"} ; regexSingleArgNoPatternInsensitive process where command_line regex~ "net\\.exe" ; -"term":{"command_line":{"value":"net.exe","case_insensitive":true,"boost":1.0} +"term":{"command_line":{"value":"net.exe","case_insensitive":true} ; regexSingleArg diff --git a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/MlJobIT.java b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/MlJobIT.java index 75a16e393af0b..760c306be7ac9 100644 --- a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/MlJobIT.java +++ b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/MlJobIT.java @@ -213,7 +213,7 @@ public void testCreateJobsWithIndexNameOption() throws Exception { aliasesResponse, containsString( """ - "%s":{"filter":{"term":{"job_id":{"value":"%s","boost":1.0}}},"is_hidden":true}""".formatted( + "%s":{"filter":{"term":{"job_id":{"value":"%s"}}},"is_hidden":true}""".formatted( AnomalyDetectorsIndex.jobResultsAliasedName(jobId1), jobId1 ) @@ -225,7 +225,7 @@ public void testCreateJobsWithIndexNameOption() throws Exception { aliasesResponse, containsString( """ - "%s":{"filter":{"term":{"job_id":{"value":"%s","boost":1.0}}},"is_hidden":true}""".formatted( + "%s":{"filter":{"term":{"job_id":{"value":"%s"}}},"is_hidden":true}""".formatted( AnomalyDetectorsIndex.jobResultsAliasedName(jobId2), jobId2 ) @@ -908,7 +908,7 @@ public void testDelete_multipleRequest() throws Exception { } String expectedReadAliasString = """ - "%s":{"filter":{"term":{"job_id":{"value":"%s","boost":1.0}}},"is_hidden":true}""".formatted( + "%s":{"filter":{"term":{"job_id":{"value":"%s"}}},"is_hidden":true}""".formatted( AnomalyDetectorsIndex.jobResultsAliasedName(jobId), jobId ); diff --git a/x-pack/plugin/search-business-rules/src/test/java/org/elasticsearch/xpack/searchbusinessrules/PinnedQueryBuilderTests.java b/x-pack/plugin/search-business-rules/src/test/java/org/elasticsearch/xpack/searchbusinessrules/PinnedQueryBuilderTests.java index 7951b97e0412f..12e94bd820522 100644 --- a/x-pack/plugin/search-business-rules/src/test/java/org/elasticsearch/xpack/searchbusinessrules/PinnedQueryBuilderTests.java +++ b/x-pack/plugin/search-business-rules/src/test/java/org/elasticsearch/xpack/searchbusinessrules/PinnedQueryBuilderTests.java @@ -154,8 +154,7 @@ public void testIdsFromJson() throws IOException { "organic": { "term": { "tag": { - "value": "tech", - "boost": 1.0 + "value": "tech" } } }, @@ -178,8 +177,7 @@ public void testDocsFromJson() throws IOException { "organic": { "term": { "tag": { - "value": "tech", - "boost": 1.0 + "value": "tech" } } }, diff --git a/x-pack/plugin/sql/qa/server/single-node/src/javaRestTest/java/org/elasticsearch/xpack/sql/qa/single_node/CliExplainIT.java b/x-pack/plugin/sql/qa/server/single-node/src/javaRestTest/java/org/elasticsearch/xpack/sql/qa/single_node/CliExplainIT.java index d4ead613c00cf..717e4a4eedd00 100644 --- a/x-pack/plugin/sql/qa/server/single-node/src/javaRestTest/java/org/elasticsearch/xpack/sql/qa/single_node/CliExplainIT.java +++ b/x-pack/plugin/sql/qa/server/single-node/src/javaRestTest/java/org/elasticsearch/xpack/sql/qa/single_node/CliExplainIT.java @@ -92,8 +92,7 @@ public void testExplainWithWhere() throws IOException { assertThat(readLine(), startsWith(" \"query\" : {")); assertThat(readLine(), startsWith(" \"term\" : {")); assertThat(readLine(), startsWith(" \"i\" : {")); - assertThat(readLine(), startsWith(" \"value\" : 2,")); - assertThat(readLine(), startsWith(" \"boost\" : 1.0")); + assertThat(readLine(), startsWith(" \"value\" : 2")); assertThat(readLine(), startsWith(" }")); assertThat(readLine(), startsWith(" }")); assertThat(readLine(), startsWith(" },")); diff --git a/x-pack/plugin/sql/src/test/resources/org/elasticsearch/xpack/sql/planner/querytranslator_tests.txt b/x-pack/plugin/sql/src/test/resources/org/elasticsearch/xpack/sql/planner/querytranslator_tests.txt index 1dbe95eba2144..d80d7d61908fd 100644 --- a/x-pack/plugin/sql/src/test/resources/org/elasticsearch/xpack/sql/planner/querytranslator_tests.txt +++ b/x-pack/plugin/sql/src/test/resources/org/elasticsearch/xpack/sql/planner/querytranslator_tests.txt @@ -30,17 +30,17 @@ /////////////// TermEqualityAnalyzer SELECT some.string FROM test WHERE some.string = 'value'; -"term":{"some.string.typical":{"value":"value", +"term":{"some.string.typical":{"value":"value" ; TermEqualityNotAnalyzed SELECT some.string FROM test WHERE int = 5; -CONTAINS "term":{"int":{"value":5, +CONTAINS "term":{"int":{"value":5 ; TermEqualityForDate SELECT some.string FROM test WHERE date = 5; -"term":{"date":{"value":5, +"term":{"date":{"value":5 ; EqualsAndInOnTheSameField