Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into esql_functions_never_…
Browse files Browse the repository at this point in the history
…return_text
  • Loading branch information
craigtaverner committed Oct 18, 2024
2 parents de7154d + 9050f8d commit 2d93a2c
Show file tree
Hide file tree
Showing 72 changed files with 222 additions and 276 deletions.
4 changes: 2 additions & 2 deletions .buildkite/hooks/pre-command
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ export COMPOSE_HTTP_TIMEOUT
JOB_BRANCH="$BUILDKITE_BRANCH"
export JOB_BRANCH

GRADLEW="./gradlew --parallel --scan --build-cache --no-watch-fs -Dorg.elasticsearch.build.cache.url=https://gradle-enterprise.elastic.co/cache/"
GRADLEW="./gradlew --console=plain --parallel --scan --build-cache --no-watch-fs -Dorg.elasticsearch.build.cache.url=https://gradle-enterprise.elastic.co/cache/"
export GRADLEW

GRADLEW_BAT="./gradlew.bat --parallel --scan --build-cache --no-watch-fs -Dorg.elasticsearch.build.cache.url=https://gradle-enterprise.elastic.co/cache/"
GRADLEW_BAT="./gradlew.bat --console=plain --parallel --scan --build-cache --no-watch-fs -Dorg.elasticsearch.build.cache.url=https://gradle-enterprise.elastic.co/cache/"
export GRADLEW_BAT

export $(cat .ci/java-versions.properties | grep '=' | xargs)
Expand Down
2 changes: 1 addition & 1 deletion .ci/scripts/packaging-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,5 @@ sudo -E env \
--unset=JAVA_HOME \
SYSTEM_JAVA_HOME=`readlink -f -n $BUILD_JAVA_HOME` \
DOCKER_CONFIG="${HOME}/.docker" \
./gradlew -g $HOME/.gradle --scan --parallel --build-cache -Dorg.elasticsearch.build.cache.url=https://gradle-enterprise.elastic.co/cache/ --continue $@
./gradlew -g $HOME/.gradle --console=plain --scan --parallel --build-cache -Dorg.elasticsearch.build.cache.url=https://gradle-enterprise.elastic.co/cache/ --continue $@

Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public abstract class AbstractDocValuesForUtilBenchmark {
protected final int blockSize;

public AbstractDocValuesForUtilBenchmark() {
this.forUtil = new DocValuesForUtil();
this.forUtil = new DocValuesForUtil(ES87TSDBDocValuesFormat.NUMERIC_BLOCK_SIZE);
this.blockSize = ES87TSDBDocValuesFormat.NUMERIC_BLOCK_SIZE;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import org.apache.lucene.store.ByteArrayDataInput;
import org.apache.lucene.store.ByteArrayDataOutput;
import org.apache.lucene.store.DataOutput;
import org.elasticsearch.index.codec.tsdb.DocValuesForUtil;
import org.openjdk.jmh.infra.Blackhole;

import java.io.IOException;
Expand Down Expand Up @@ -44,7 +43,7 @@ public void setupInvocation(int bitsPerValue) {

@Override
public void benchmark(int bitsPerValue, Blackhole bh) throws IOException {
DocValuesForUtil.decode(bitsPerValue, this.dataInput, this.output);
forUtil.decode(bitsPerValue, this.dataInput, this.output);
bh.consume(this.output);
}
}
5 changes: 0 additions & 5 deletions docs/plugins/mapper-annotated-text.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,6 @@ be changed or removed in a future release. Elastic will work to fix
any issues, but features in technical preview are not subject to the support SLA
of official GA features.

`annotated_text` fields support {ref}/mapping-source-field.html#synthetic-source[synthetic `_source`] if they have
a {ref}/keyword.html#keyword-synthetic-source[`keyword`] sub-field that supports synthetic
`_source` or if the `annotated_text` field sets `store` to `true`. Either way, it may
not have {ref}/copy-to.html[`copy_to`].

If using a sub-`keyword` field then the values are sorted in the same way as
a `keyword` field's values are sorted. By default, that means sorted with
duplicates removed. So:
Expand Down
3 changes: 1 addition & 2 deletions docs/reference/how-to/knn-search.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ since it relies on separate data structures to perform the search. Before
using the <<include-exclude, `excludes`>> parameter, make sure to review the
downsides of omitting fields from `_source`.

Another option is to use <<synthetic-source,synthetic `_source`>> if all
your index fields support it.
Another option is to use <<synthetic-source,synthetic `_source`>>.

[discrete]
=== Ensure data nodes have enough memory
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/reference/inference/inference-apis.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ the following APIs to manage {infer} models and perform {infer}:

[[inference-landscape]]
.A representation of the Elastic inference landscape
image::images/inference-landscape.png[A representation of the Elastic inference landscape,align="center"]
image::images/inference-landscape.jpg[A representation of the Elastic inference landscape,align="center"]

An {infer} endpoint enables you to use the corresponding {ml} model without
manual deployment and apply it to your data at ingestion time through
Expand Down
3 changes: 0 additions & 3 deletions docs/reference/mapping/types/aggregate-metric-double.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,6 @@ be changed or removed in a future release. Elastic will work to fix
any issues, but features in technical preview are not subject to the support SLA
of official GA features.

`aggregate_metric-double` fields support <<synthetic-source,synthetic `_source`>> in their default
configuration.

For example:
[source,console,id=synthetic-source-aggregate-metric-double-example]
----
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/mapping/types/binary.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ be changed or removed in a future release. Elastic will work to fix
any issues, but features in technical preview are not subject to the support SLA
of official GA features.

`binary` fields support <<synthetic-source,synthetic `_source`>> only when <<doc-values,`doc_values`>> are enabled. Synthetic source always sorts `binary` values in order of their byte representation. For example:
Synthetic source may sort `binary` values in order of their byte representation. For example:
[source,console,id=synthetic-source-binary-example]
----
PUT idx
Expand Down
5 changes: 2 additions & 3 deletions docs/reference/mapping/types/boolean.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,9 @@ any issues, but features in technical preview are not subject to the support SLA
of official GA features.

`boolean` fields support <<synthetic-source,synthetic `_source`>> in their
default configuration. Synthetic `_source` cannot be used together with
<<copy-to,`copy_to`>> or with <<doc-values,`doc_values`>> disabled.
default configuration.

Synthetic source always sorts `boolean` fields. For example:
Synthetic source may sort `boolean` field values. For example:
[source,console,id=synthetic-source-boolean-example]
----
PUT idx
Expand Down
6 changes: 1 addition & 5 deletions docs/reference/mapping/types/date.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,7 @@ be changed or removed in a future release. Elastic will work to fix
any issues, but features in technical preview are not subject to the support SLA
of official GA features.

`date` fields support <<synthetic-source,synthetic `_source`>> in their
default configuration. Synthetic `_source` cannot be used together with
<<copy-to,`copy_to`>> or with <<doc-values,`doc_values`>> disabled.

Synthetic source always sorts `date` fields. For example:
Synthetic source may sort `date` field values. For example:
[source,console,id=synthetic-source-date-example]
----
PUT idx
Expand Down
7 changes: 1 addition & 6 deletions docs/reference/mapping/types/date_nanos.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,7 @@ be changed or removed in a future release. Elastic will work to fix
any issues, but features in technical preview are not subject to the support SLA
of official GA features.

`date_nanos` fields support <<synthetic-source,synthetic `_source`>> in their
default configuration. Synthetic `_source` cannot be used together with
<<copy-to,`copy_to`>>, <<ignore-malformed,`ignore_malformed`>> set to true
or with <<doc-values,`doc_values`>> disabled.

Synthetic source always sorts `date_nanos` fields. For example:
Synthetic source may sort `date_nanos` field values. For example:
[source,console,id=synthetic-source-date-nanos-example]
----
PUT idx
Expand Down
5 changes: 2 additions & 3 deletions docs/reference/mapping/types/flattened.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -325,10 +325,9 @@ any issues, but features in technical preview are not subject to the support SLA
of official GA features.

Flattened fields support <<synthetic-source,synthetic`_source`>> in their default
configuration. Synthetic `_source` cannot be used with <<doc-values,`doc_values`>>
disabled.
configuration.

Synthetic source always sorts alphabetically and de-duplicates flattened fields.
Synthetic source may sort `flattened` field values and remove duplicates.
For example:
[source,console,id=synthetic-source-flattened-sorting-example]
----
Expand Down
6 changes: 1 addition & 5 deletions docs/reference/mapping/types/geo-point.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,7 @@ be changed or removed in a future release. Elastic will work to fix
any issues, but features in technical preview are not subject to the support SLA
of official GA features.

`geo_point` fields support <<synthetic-source,synthetic `_source`>> in their
default configuration. Synthetic `_source` cannot be used together with <<copy-to,`copy_to`>> or with
<<doc-values,`doc_values`>> disabled.

Synthetic source always sorts `geo_point` fields (first by latitude and then
Synthetic source may sort `geo_point` fields (first by latitude and then
longitude) and reduces them to their stored precision. For example:
[source,console,id=synthetic-source-geo-point-example]
----
Expand Down
3 changes: 0 additions & 3 deletions docs/reference/mapping/types/geo-shape.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,3 @@ synthetic `_source` is in technical preview. Features in technical preview may
be changed or removed in a future release. Elastic will work to fix
any issues, but features in technical preview are not subject to the support SLA
of official GA features.

`geo_shape` fields support <<synthetic-source,synthetic `_source`>> in their
default configuration.
2 changes: 1 addition & 1 deletion docs/reference/mapping/types/histogram.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ any issues, but features in technical preview are not subject to the support SLA
of official GA features.

`histogram` fields support <<synthetic-source,synthetic `_source`>> in their
default configuration. Synthetic `_source` cannot be used together with <<copy-to,`copy_to`>>.
default configuration.

NOTE: To save space, zero-count buckets are not stored in the histogram doc values.
As a result, when indexing a histogram field in an index with synthetic source enabled,
Expand Down
6 changes: 1 addition & 5 deletions docs/reference/mapping/types/ip.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,7 @@ be changed or removed in a future release. Elastic will work to fix
any issues, but features in technical preview are not subject to the support SLA
of official GA features.

`ip` fields support <<synthetic-source,synthetic `_source`>> in their default
configuration. Synthetic `_source` cannot be used together with
<<copy-to,`copy_to`>> or with <<doc-values,`doc_values`>> disabled.

Synthetic source always sorts `ip` fields and removes duplicates. For example:
Synthetic source may sort `ip` field values and remove duplicates. For example:
[source,console,id=synthetic-source-ip-example]
----
PUT idx
Expand Down
6 changes: 1 addition & 5 deletions docs/reference/mapping/types/keyword.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,7 @@ be changed or removed in a future release. Elastic will work to fix
any issues, but features in technical preview are not subject to the support SLA
of official GA features.

`keyword` fields support <<synthetic-source,synthetic `_source`>> in their
default configuration. Synthetic `_source` cannot be used together with
a <<normalizer,`normalizer`>> or <<copy-to,`copy_to`>>.

By default, synthetic source sorts `keyword` fields and removes duplicates.
Synthetic source may sort `keyword` fields and remove duplicates.
For example:
[source,console,id=synthetic-source-keyword-example-default]
----
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/mapping/types/numeric.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ All numeric fields support <<synthetic-source,synthetic
together with <<copy-to,`copy_to`>>, or
with <<doc-values,`doc_values`>> disabled.

Synthetic source always sorts numeric fields. For example:
Synthetic source may sort numeric field values. For example:
[source,console,id=synthetic-source-numeric-example]
----
PUT idx
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/mapping/types/range.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,9 @@ any issues, but features in technical preview are not subject to the support SLA
of official GA features.

`range` fields support <<synthetic-source,synthetic `_source`>> in their default
configuration. Synthetic `_source` cannot be used with <<doc-values,`doc_values`>> disabled.
configuration.

Synthetic source always sorts values and removes duplicates for all `range` fields except `ip_range`. Ranges are sorted by their lower bound and then by upper bound. For example:
Synthetic source may sort `range` field values and remove duplicates for all `range` fields except `ip_range`. Ranges are sorted by their lower bound and then by upper bound. For example:
[source,console,id=synthetic-source-range-sorting-example]
----
PUT idx
Expand Down
3 changes: 1 addition & 2 deletions docs/reference/mapping/types/search-as-you-type.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -266,5 +266,4 @@ any issues, but features in technical preview are not subject to the support SLA
of official GA features.

`search_as_you_type` fields support <<synthetic-source,synthetic `_source`>> in their
default configuration. Synthetic `_source` cannot be used together with
<<copy-to,`copy_to`>>.
default configuration.
4 changes: 0 additions & 4 deletions docs/reference/mapping/types/text.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,6 @@ The following parameters are accepted by `text` fields:

Whether the field value should be stored and retrievable separately from
the <<mapping-source-field,`_source`>> field. Accepts `true` or `false` (default).
This parameter will be automatically set to `true` for TSDB indices
(indices that have `index.mode` set to `time_series`)
if there is no <<keyword-synthetic-source, `keyword`>>
sub-field that supports synthetic `_source`.

<<search-analyzer,`search_analyzer`>>::

Expand Down
3 changes: 1 addition & 2 deletions docs/reference/mapping/types/token-count.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,4 @@ any issues, but features in technical preview are not subject to the support SLA
of official GA features.

`token_count` fields support <<synthetic-source,synthetic `_source`>> in their
default configuration. Synthetic `_source` cannot be used together with
<<copy-to,`copy_to`>>.
default configuration.
6 changes: 3 additions & 3 deletions docs/reference/mapping/types/version.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ be changed or removed in a future release. Elastic will work to fix
any issues, but features in technical preview are not subject to the support SLA
of official GA features.

`version` fields support <<synthetic-source,synthetic `_source`>> so long as they don't
declare <<copy-to,`copy_to`>>.
`version` fields support <<synthetic-source,synthetic `_source`>> in their
default configuration..

Synthetic source always sorts `version` fields and removes duplicates. For example:
Synthetic source may sort `version` field values and remove duplicates. For example:
[source,console,id=synthetic-source-version-example]
----
PUT idx
Expand Down
4 changes: 1 addition & 3 deletions docs/reference/mapping/types/wildcard.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,8 @@ The following parameters are accepted by `wildcard` fields:

[[wildcard-synthetic-source]]
==== Synthetic `_source`
`wildcard` fields support <<synthetic-source,synthetic `_source`>> so long as they don't
declare <<copy-to,`copy_to`>>.

Synthetic source always sorts `wildcard` fields. For example:
Synthetic source may sort `wildcard` field values. For example:
[source,console,id=synthetic-source-wildcard-example]
----
PUT idx
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public static void startServer() throws Throwable {
server.createContext("/404/", exchange -> {
try {
exchange.sendResponseHeaders(404, 0);
exchange.close();
} catch (Exception e) {
fail(e);
}
Expand Down Expand Up @@ -102,6 +103,7 @@ public boolean checkCredentials(String username, String password) {
exchange.getResponseHeaders().add("Location", "/" + destination + "/");
}
exchange.sendResponseHeaders(302, 0);
exchange.close();
} catch (Exception e) {
fail(e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
import org.elasticsearch.common.logging.DeprecationLogger;
import org.elasticsearch.common.xcontent.LoggingDeprecationHandler;
import org.elasticsearch.common.xcontent.XContentHelper;
import org.elasticsearch.core.RestApiVersion;
import org.elasticsearch.index.IndexVersion;
import org.elasticsearch.index.IndexVersions;
import org.elasticsearch.index.fielddata.FieldDataContext;
Expand Down Expand Up @@ -84,7 +83,6 @@
import java.util.function.BiConsumer;
import java.util.function.Supplier;

import static org.elasticsearch.core.RestApiVersion.equalTo;
import static org.elasticsearch.search.SearchService.ALLOW_EXPENSIVE_QUERIES;
import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg;
import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg;
Expand Down Expand Up @@ -368,14 +366,6 @@ protected void doXContent(XContentBuilder builder, Params params) throws IOExcep
DOCUMENTS_FIELD.getPreferredName(),
INDEXED_DOCUMENT_FIELD_ID.getPreferredName()
);
PARSER.declareString(
deprecateAndIgnoreType("percolate_with_type", TYPE_DEPRECATION_MESSAGE),
INDEXED_DOCUMENT_FIELD_TYPE.forRestApiVersion(equalTo(RestApiVersion.V_7))
);
PARSER.declareString(
deprecateAndIgnoreType("percolate_with_document_type", DOCUMENT_TYPE_DEPRECATION_MESSAGE),
DOCUMENT_TYPE_FIELD.forRestApiVersion(equalTo(RestApiVersion.V_7))
);
}

private static BiConsumer<PercolateQueryBuilder, String> deprecateAndIgnoreType(String key, String message) {
Expand Down
2 changes: 0 additions & 2 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,6 @@ tests:
- class: org.elasticsearch.xpack.inference.rest.ServerSentEventsRestActionListenerTests
method: testNoStream
issue: https://github.com/elastic/elasticsearch/issues/114788
- class: org.elasticsearch.ingest.geoip.HttpClientTests
issue: https://github.com/elastic/elasticsearch/issues/112618
- class: org.elasticsearch.xpack.remotecluster.RemoteClusterSecurityWithApmTracingRestIT
method: testTracingCrossCluster
issue: https://github.com/elastic/elasticsearch/issues/112731
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import org.elasticsearch.cluster.metadata.DataStream;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.core.RestApiVersion;
import org.elasticsearch.index.mapper.MapperService;
import org.elasticsearch.tasks.CancellableTask;
import org.elasticsearch.tasks.Task;
Expand Down Expand Up @@ -57,19 +56,6 @@ public class RolloverRequest extends AcknowledgedRequest<RolloverRequest> implem
CreateIndexRequest.SETTINGS,
ObjectParser.ValueType.OBJECT
);
PARSER.declareField((parser, request, context) -> {
// a type is not included, add a dummy _doc type
Map<String, Object> mappings = parser.map();
if (MapperService.isMappingSourceTyped(MapperService.SINGLE_MAPPING_NAME, mappings)) {
throw new IllegalArgumentException(
"The mapping definition cannot be nested under a type "
+ "["
+ MapperService.SINGLE_MAPPING_NAME
+ "] unless include_type_name is set to true."
);
}
request.createIndexRequest.mapping(mappings);
}, CreateIndexRequest.MAPPINGS.forRestApiVersion(RestApiVersion.equalTo(RestApiVersion.V_7)), ObjectParser.ValueType.OBJECT);
PARSER.declareField((parser, request, context) -> {
// a type is not included, add a dummy _doc type
Map<String, Object> mappings = parser.map();
Expand All @@ -78,7 +64,7 @@ public class RolloverRequest extends AcknowledgedRequest<RolloverRequest> implem
throw new IllegalArgumentException("The mapping definition cannot be nested under a type");
}
request.createIndexRequest.mapping(mappings);
}, CreateIndexRequest.MAPPINGS.forRestApiVersion(RestApiVersion.onOrAfter(RestApiVersion.V_8)), ObjectParser.ValueType.OBJECT);
}, CreateIndexRequest.MAPPINGS, ObjectParser.ValueType.OBJECT);

PARSER.declareField(
(parser, request, context) -> request.createIndexRequest.aliases(parser.map()),
Expand Down
Loading

0 comments on commit 2d93a2c

Please sign in to comment.