Skip to content

Commit

Permalink
Merge branch 'main' into 111976_fix
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Oct 14, 2024
2 parents 38602f8 + a262eb6 commit f197a01
Show file tree
Hide file tree
Showing 63 changed files with 4,464 additions and 2,336 deletions.
5 changes: 5 additions & 0 deletions docs/changelog/113374.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 113374
summary: Add ESQL match function
area: ES|QL
type: feature
issues: []
5 changes: 5 additions & 0 deletions docs/reference/esql/functions/description/match.asciidoc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions docs/reference/esql/functions/examples/match.asciidoc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

85 changes: 85 additions & 0 deletions docs/reference/esql/functions/kibana/definition/match.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions docs/reference/esql/functions/kibana/docs/match.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions docs/reference/esql/functions/layout/match.asciidoc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions docs/reference/esql/functions/parameters/match.asciidoc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/reference/esql/functions/signature/match.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions docs/reference/esql/functions/types/match.asciidoc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/index-modules.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ preview:[]

The number of shards a custom <<mapping-routing-field,routing>> value can go to.
Defaults to 1 and can only be set at index creation time. This value must be less
than the `index.number_of_shards` unless the `index.number_of_shards` value is also 1.
than the `index.number_of_routing_shards` unless the `index.number_of_routing_shards` value is also 1.
See <<routing-index-partition>> for more details about how this setting is used.

[[ccr-index-soft-deletes]]
Expand Down
6 changes: 0 additions & 6 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -283,12 +283,6 @@ tests:
- class: org.elasticsearch.ingest.geoip.DatabaseNodeServiceIT
method: testGzippedDatabase
issue: https://github.com/elastic/elasticsearch/issues/113752
- class: org.elasticsearch.backwards.MixedClusterClientYamlTestSuiteIT
method: test {p0=indices.split/40_routing_partition_size/more than 1}
issue: https://github.com/elastic/elasticsearch/issues/113841
- class: org.elasticsearch.backwards.MixedClusterClientYamlTestSuiteIT
method: test {p0=indices.split/40_routing_partition_size/nested}
issue: https://github.com/elastic/elasticsearch/issues/113842
- class: org.elasticsearch.threadpool.SimpleThreadPoolIT
method: testThreadPoolMetrics
issue: https://github.com/elastic/elasticsearch/issues/108320
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ public class CcsCommonYamlTestSuiteIT extends ESClientYamlSuiteTestCase {
.setting("xpack.security.enabled", "false")
// geohex_grid requires gold license
.setting("xpack.license.self_generated.type", "trial")
.feature(FeatureFlag.TIME_SERIES_MODE);
.feature(FeatureFlag.TIME_SERIES_MODE)
.feature(FeatureFlag.SUB_OBJECTS_AUTO_ENABLED);

private static ElasticsearchCluster remoteCluster = ElasticsearchCluster.local()
.name(REMOTE_CLUSTER_NAME)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ public class RcsCcsCommonYamlTestSuiteIT extends ESClientYamlSuiteTestCase {
.setting("xpack.security.remote_cluster_server.ssl.enabled", "false")
.setting("xpack.security.remote_cluster_client.ssl.enabled", "false")
.feature(FeatureFlag.TIME_SERIES_MODE)
.feature(FeatureFlag.SUB_OBJECTS_AUTO_ENABLED)
.user("test_admin", "x-pack-test-password");

private static ElasticsearchCluster fulfillingCluster = ElasticsearchCluster.local()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public class SmokeTestMultiNodeClientYamlTestSuiteIT extends ESClientYamlSuiteTe
// The first node does not have the ingest role so we're sure ingest requests are forwarded:
.node(0, n -> n.setting("node.roles", "[master,data,ml,remote_cluster_client,transform]"))
.feature(FeatureFlag.TIME_SERIES_MODE)
.feature(FeatureFlag.SUB_OBJECTS_AUTO_ENABLED)
.build();

public SmokeTestMultiNodeClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public class ClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase {
.module("health-shards-availability")
.module("data-streams")
.feature(FeatureFlag.TIME_SERIES_MODE)
.feature(FeatureFlag.SUB_OBJECTS_AUTO_ENABLED)
.build();

public ClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ public void testPartitionedTemplate() throws Exception {
);
assertThat(
eBadSettings.getMessage(),
containsString("partition size [6] should be a positive number less than the number of shards [5]")
containsString("partition size [6] should be a positive number less than the number of routing shards [5]")
);

// provide an invalid mapping for a partitioned index
Expand Down Expand Up @@ -913,7 +913,7 @@ public void testPartitionedTemplate() throws Exception {

assertThat(
eBadIndex.getMessage(),
containsString("partition size [6] should be a positive number less than the number of shards [5]")
containsString("partition size [6] should be a positive number less than the number of routing shards [5]")
);

// finally, create a valid index
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2265,7 +2265,7 @@ IndexMetadata build(boolean repair) {
"routing partition size ["
+ routingPartitionSize
+ "] should be a positive number"
+ " less than the number of shards ["
+ " less than the number of routing shards ["
+ getRoutingNumShards()
+ "] for ["
+ index
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.elasticsearch.index.mapper.FieldMapper;
import org.elasticsearch.index.mapper.IgnoredSourceFieldMapper;
import org.elasticsearch.index.mapper.MapperService;
import org.elasticsearch.index.mapper.SourceFieldMapper;
import org.elasticsearch.index.similarity.SimilarityService;
import org.elasticsearch.index.store.FsDirectoryFactory;
import org.elasticsearch.index.store.Store;
Expand Down Expand Up @@ -186,6 +187,7 @@ public final class IndexScopedSettings extends AbstractScopedSettings {
FieldMapper.SYNTHETIC_SOURCE_KEEP_INDEX_SETTING,
IgnoredSourceFieldMapper.SKIP_IGNORED_SOURCE_WRITE_SETTING,
IgnoredSourceFieldMapper.SKIP_IGNORED_SOURCE_READ_SETTING,
SourceFieldMapper.INDEX_MAPPER_SOURCE_MODE_SETTING,

// validate that built-in similarities don't get redefined
Setting.groupSetting("index.similarity.", (s) -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.elasticsearch.features.NodeFeature;
import org.elasticsearch.index.mapper.IgnoredSourceFieldMapper;
import org.elasticsearch.index.mapper.Mapper;
import org.elasticsearch.index.mapper.SourceFieldMapper;
import org.elasticsearch.index.translog.Translog;
import org.elasticsearch.ingest.IngestService;
import org.elasticsearch.node.Node;
Expand Down Expand Up @@ -820,6 +821,7 @@ private void setRetentionLeaseMillis(final TimeValue retentionLease) {
private volatile long mappingDimensionFieldsLimit;
private volatile boolean skipIgnoredSourceWrite;
private volatile boolean skipIgnoredSourceRead;
private final SourceFieldMapper.Mode indexMappingSourceMode;

/**
* The maximum number of refresh listeners allows on this shard.
Expand Down Expand Up @@ -980,6 +982,7 @@ public IndexSettings(final IndexMetadata indexMetadata, final Settings nodeSetti
es87TSDBCodecEnabled = scopedSettings.get(TIME_SERIES_ES87TSDB_CODEC_ENABLED_SETTING);
skipIgnoredSourceWrite = scopedSettings.get(IgnoredSourceFieldMapper.SKIP_IGNORED_SOURCE_WRITE_SETTING);
skipIgnoredSourceRead = scopedSettings.get(IgnoredSourceFieldMapper.SKIP_IGNORED_SOURCE_READ_SETTING);
indexMappingSourceMode = scopedSettings.get(SourceFieldMapper.INDEX_MAPPER_SOURCE_MODE_SETTING);

scopedSettings.addSettingsUpdateConsumer(
MergePolicyConfig.INDEX_COMPOUND_FORMAT_SETTING,
Expand Down Expand Up @@ -1659,6 +1662,10 @@ private void setSkipIgnoredSourceRead(boolean value) {
this.skipIgnoredSourceRead = value;
}

public SourceFieldMapper.Mode getIndexMappingSourceMode() {
return indexMappingSourceMode;
}

/**
* The bounds for {@code @timestamp} on this index or
* {@code null} if there are no bounds.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.elasticsearch.common.Explicit;
import org.elasticsearch.common.logging.DeprecationCategory;
import org.elasticsearch.common.logging.DeprecationLogger;
import org.elasticsearch.common.util.FeatureFlag;
import org.elasticsearch.common.xcontent.support.XContentMapValues;
import org.elasticsearch.core.Nullable;
import org.elasticsearch.features.NodeFeature;
Expand All @@ -41,6 +42,7 @@

public class ObjectMapper extends Mapper {
private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(ObjectMapper.class);
public static final FeatureFlag SUB_OBJECTS_AUTO_FEATURE_FLAG = new FeatureFlag("sub_objects_auto");

public static final String CONTENT_TYPE = "object";
static final String STORE_ARRAY_SOURCE_PARAM = "store_array_source";
Expand Down Expand Up @@ -74,7 +76,7 @@ public static Subobjects from(Object node) {
if (value.equalsIgnoreCase("false")) {
return DISABLED;
}
if (value.equalsIgnoreCase("auto")) {
if (SUB_OBJECTS_AUTO_FEATURE_FLAG.isEnabled() && value.equalsIgnoreCase("auto")) {
return AUTO;
}
}
Expand Down
Loading

0 comments on commit f197a01

Please sign in to comment.