Skip to content

Commit 88bd226

Browse files
authored
Merge branch 'main' into esql-MV_CONTAINS_ALL
2 parents 1a1b88d + 00fe9f5 commit 88bd226

File tree

121 files changed

+1834
-609
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+1834
-609
lines changed
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the "Elastic License
4+
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+
* Public License v 1"; you may not use this file except in compliance with, at
6+
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7+
* License v3.0 only", or the "Server Side Public License, v 1".
8+
*/
9+
10+
package org.elasticsearch.benchmark.common.network;
11+
12+
import org.elasticsearch.common.network.InetAddresses;
13+
import org.elasticsearch.xcontent.Text;
14+
import org.elasticsearch.xcontent.XContentString;
15+
import org.openjdk.jmh.annotations.Benchmark;
16+
import org.openjdk.jmh.annotations.BenchmarkMode;
17+
import org.openjdk.jmh.annotations.Fork;
18+
import org.openjdk.jmh.annotations.Measurement;
19+
import org.openjdk.jmh.annotations.Mode;
20+
import org.openjdk.jmh.annotations.OutputTimeUnit;
21+
import org.openjdk.jmh.annotations.Param;
22+
import org.openjdk.jmh.annotations.Scope;
23+
import org.openjdk.jmh.annotations.Setup;
24+
import org.openjdk.jmh.annotations.State;
25+
import org.openjdk.jmh.annotations.Warmup;
26+
import org.openjdk.jmh.infra.Blackhole;
27+
28+
import java.net.InetAddress;
29+
import java.net.UnknownHostException;
30+
import java.util.Random;
31+
import java.util.concurrent.TimeUnit;
32+
33+
@Warmup(iterations = 2)
34+
@Measurement(iterations = 3)
35+
@BenchmarkMode(Mode.Throughput)
36+
@OutputTimeUnit(TimeUnit.SECONDS)
37+
@State(Scope.Benchmark)
38+
@Fork(1)
39+
public class IpAddressesBenchmarks {
40+
41+
@Param("1000")
42+
private int size;
43+
private String[] ipV6Addresses;
44+
private String[] ipV4Addresses;
45+
private XContentString[] ipV6AddressesBytes;
46+
private XContentString[] ipV4AddressesBytes;
47+
48+
@Setup
49+
public void setup() throws UnknownHostException {
50+
Random random = new Random();
51+
ipV6Addresses = new String[size];
52+
ipV4Addresses = new String[size];
53+
ipV6AddressesBytes = new XContentString[size];
54+
ipV4AddressesBytes = new XContentString[size];
55+
byte[] ipv6Bytes = new byte[16];
56+
byte[] ipv4Bytes = new byte[4];
57+
for (int i = 0; i < size; i++) {
58+
random.nextBytes(ipv6Bytes);
59+
random.nextBytes(ipv4Bytes);
60+
String ipv6String = InetAddresses.toAddrString(InetAddress.getByAddress(ipv6Bytes));
61+
String ipv4String = InetAddresses.toAddrString(InetAddress.getByAddress(ipv4Bytes));
62+
ipV6Addresses[i] = ipv6String;
63+
ipV4Addresses[i] = ipv4String;
64+
ipV6AddressesBytes[i] = new Text(ipv6String);
65+
ipV4AddressesBytes[i] = new Text(ipv4String);
66+
}
67+
}
68+
69+
@Benchmark
70+
public boolean isInetAddressIpv6() {
71+
boolean b = true;
72+
for (int i = 0; i < size; i++) {
73+
b ^= InetAddresses.isInetAddress(ipV6Addresses[i]);
74+
}
75+
return b;
76+
}
77+
78+
@Benchmark
79+
public boolean isInetAddressIpv4() {
80+
boolean b = true;
81+
for (int i = 0; i < size; i++) {
82+
b ^= InetAddresses.isInetAddress(ipV4Addresses[i]);
83+
}
84+
return b;
85+
}
86+
87+
@Benchmark
88+
public void getIpOrHostIpv6(Blackhole blackhole) {
89+
for (int i = 0; i < size; i++) {
90+
blackhole.consume(InetAddresses.getIpOrHost(ipV6Addresses[i]));
91+
}
92+
}
93+
94+
@Benchmark
95+
public void getIpOrHostIpv4(Blackhole blackhole) {
96+
for (int i = 0; i < size; i++) {
97+
blackhole.consume(InetAddresses.forString(ipV4Addresses[i]));
98+
}
99+
}
100+
101+
@Benchmark
102+
public void forStringIpv6String(Blackhole blackhole) {
103+
for (int i = 0; i < size; i++) {
104+
blackhole.consume(InetAddresses.forString(ipV6Addresses[i]));
105+
}
106+
}
107+
108+
@Benchmark
109+
public void forStringIpv4String(Blackhole blackhole) {
110+
for (int i = 0; i < size; i++) {
111+
blackhole.consume(InetAddresses.forString(ipV4Addresses[i]));
112+
}
113+
}
114+
115+
@Benchmark
116+
public void forStringIpv6Bytes(Blackhole blackhole) {
117+
for (int i = 0; i < size; i++) {
118+
blackhole.consume(InetAddresses.forString(ipV6AddressesBytes[i].bytes()));
119+
}
120+
}
121+
122+
@Benchmark
123+
public void forStringIpv4Bytes(Blackhole blackhole) {
124+
for (int i = 0; i < size; i++) {
125+
blackhole.consume(InetAddresses.forString(ipV4AddressesBytes[i].bytes()));
126+
}
127+
}
128+
129+
@Benchmark
130+
public void encodeAsIpv6WithIpv6(Blackhole blackhole) {
131+
for (int i = 0; i < size; i++) {
132+
blackhole.consume(InetAddresses.encodeAsIpv6(ipV6AddressesBytes[i]));
133+
}
134+
}
135+
136+
@Benchmark
137+
public void encodeAsIpv6WithIpv4(Blackhole blackhole) {
138+
for (int i = 0; i < size; i++) {
139+
blackhole.consume(InetAddresses.encodeAsIpv6(ipV4AddressesBytes[i]));
140+
}
141+
}
142+
}

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/transport/TransportVersionResourcesPlugin.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,9 @@ public void apply(Project project) {
6161
t.getDefinitionsDirectory().set(getDefinitionsDirectory(getResourcesDirectory(project)));
6262
t.getManifestFile().set(project.getLayout().getBuildDirectory().file("generated-resources/manifest.txt"));
6363
});
64+
String resourceRoot = TransportVersionUtils.getResourceRoot(project);
6465
project.getTasks().named(JavaPlugin.PROCESS_RESOURCES_TASK_NAME, Copy.class).configure(t -> {
65-
t.into("transport/definitions", c -> c.from(generateManifestTask));
66+
t.into(resourceRoot + "/definitions", c -> c.from(generateManifestTask));
6667
});
6768
}
6869
}

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/transport/TransportVersionUtils.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,16 @@ static Directory getResourcesDirectory(Project project) {
5050
if (projectName == null) {
5151
projectName = ":server";
5252
}
53+
var resourceRoot = getResourceRoot(project);
5354
Directory projectDir = project.project(projectName.toString()).getLayout().getProjectDirectory();
54-
return projectDir.dir("src/main/resources/transport");
55+
return projectDir.dir("src/main/resources/" + resourceRoot);
56+
}
57+
58+
static String getResourceRoot(Project project) {
59+
var resourceRoot = project.findProperty("org.elasticsearch.transport.resourceRoot");
60+
if (resourceRoot == null) {
61+
resourceRoot = "transport";
62+
}
63+
return resourceRoot.toString();
5564
}
5665
}

docs/changelog/132959.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 132959
2+
summary: Adds the `v_hamming` function for calculating the Hamming distance between two dense vectors
3+
area: ES|QL
4+
type: feature
5+
issues: [132056]

docs/redirects.yml

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,67 @@ redirects:
2222
- to: 'reference/elasticsearch/rest-apis/retrievers/rule-retriever.md'
2323
anchors: {'rule-retriever'}
2424
- to: 'reference/elasticsearch/rest-apis/retrievers/pinned-retriever.md'
25-
anchors: {'pinned-retriever'}
25+
anchors: {'pinned-retriever'}
26+
27+
# ESQL command redirects - split from aggregate pages to individual pages
28+
'reference/query-languages/esql/commands/source-commands.md':
29+
to: 'reference/query-languages/esql/commands/source-commands.md'
30+
anchors: {} # pass-through unlisted anchors in the `many` ruleset
31+
many:
32+
- to: 'reference/query-languages/esql/commands/from.md'
33+
anchors: {'esql-from'}
34+
- to: 'reference/query-languages/esql/commands/row.md'
35+
anchors: {'esql-row'}
36+
- to: 'reference/query-languages/esql/commands/show.md'
37+
anchors: {'esql-show'}
38+
39+
# Handle old anchor references to esql-commands.md
40+
'reference/query-languages/esql/esql-commands.md':
41+
to: 'reference/query-languages/esql/esql-commands.md'
42+
anchors: {} # pass-through unlisted anchors in the `many` ruleset
43+
many:
44+
- to: 'reference/query-languages/esql/commands/source-commands.md'
45+
anchors: {'esql-source-commands'}
46+
- to: 'reference/query-languages/esql/commands/processing-commands.md'
47+
anchors: {'esql-processing-commands'}
48+
49+
'reference/query-languages/esql/commands/processing-commands.md':
50+
to: 'reference/query-languages/esql/commands/processing-commands.md'
51+
anchors: {} # pass-through unlisted anchors in the `many` ruleset
52+
many:
53+
- to: 'reference/query-languages/esql/commands/change-point.md'
54+
anchors: {'esql-change_point'}
55+
- to: 'reference/query-languages/esql/commands/completion.md'
56+
anchors: {'esql-completion'}
57+
- to: 'reference/query-languages/esql/commands/dissect.md'
58+
anchors: {'esql-dissect'}
59+
- to: 'reference/query-languages/esql/commands/drop.md'
60+
anchors: {'esql-drop'}
61+
- to: 'reference/query-languages/esql/commands/enrich.md'
62+
anchors: {'esql-enrich'}
63+
- to: 'reference/query-languages/esql/commands/eval.md'
64+
anchors: {'esql-eval'}
65+
- to: 'reference/query-languages/esql/commands/fork.md'
66+
anchors: {'esql-fork'}
67+
- to: 'reference/query-languages/esql/commands/grok.md'
68+
anchors: {'esql-grok'}
69+
- to: 'reference/query-languages/esql/commands/keep.md'
70+
anchors: {'esql-keep'}
71+
- to: 'reference/query-languages/esql/commands/limit.md'
72+
anchors: {'esql-limit'}
73+
- to: 'reference/query-languages/esql/commands/lookup-join.md'
74+
anchors: {'esql-lookup-join'}
75+
- to: 'reference/query-languages/esql/commands/mv_expand.md'
76+
anchors: {'esql-mv_expand'}
77+
- to: 'reference/query-languages/esql/commands/rename.md'
78+
anchors: {'esql-rename'}
79+
- to: 'reference/query-languages/esql/commands/rerank.md'
80+
anchors: {'esql-rerank'}
81+
- to: 'reference/query-languages/esql/commands/sample.md'
82+
anchors: {'esql-sample'}
83+
- to: 'reference/query-languages/esql/commands/sort.md'
84+
anchors: {'esql-sort'}
85+
- to: 'reference/query-languages/esql/commands/stats-by.md'
86+
anchors: {'esql-stats-by'}
87+
- to: 'reference/query-languages/esql/commands/where.md'
88+
anchors: {'esql-where'}
Lines changed: 59 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,65 @@
11
# Elasticsearch
22

3-
This section contains reference information for {{es}} and index management features.
3+
{{es}} is a distributed search and analytics engine, scalable data store, and vector database built on Apache Lucene. It’s optimized for speed and relevance on production-scale workloads. Use Elasticsearch to search, index, store, and analyze data of all shapes and sizes in near real time.
44

5-
To learn more about {{es}} features and how to get started, refer to the [{{es}}](docs-content://solutions/search.md) documentation.
5+
## Quick links
66

7-
For more details about query and scripting languages, check these sections:
8-
* [Query languages](../query-languages/index.md)
9-
* [Scripting languages](../scripting-languages/index.md)
7+
:::{dropdown} Useful links
108

11-
{{es}} also provides the following REST APIs:
9+
- [REST API Reference](./rest-apis/index.md)
10+
- [API Conventions](./rest-apis/api-conventions.md)
11+
- [Settings Reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/settings.html)
12+
- [Breaking Changes](https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking-changes.html)
13+
- [Compatibility](./rest-apis/compatibility.md)
14+
- [Glossary](https://www.elastic.co/guide/en/elasticsearch/reference/current/glossary.html)
15+
- [Plugin Development](https://www.elastic.co/guide/en/elasticsearch/plugins/current/index.html)
16+
- [Supported Platforms](https://www.elastic.co/support/matrix#matrix_jvm)
17+
:::
1218

13-
* [{{es}} API](https://www.elastic.co/docs/api/doc/elasticsearch)
14-
* [{{es}} Serverless API](https://www.elastic.co/docs/api/doc/elasticsearch-serverless)
19+
## Setup and architecture
20+
21+
- [Set up Elasticsearch](docs-content://deploy-manage/deploy/self-managed/installing-elasticsearch.md)
22+
- [Secure the Elastic Stack](docs-content://deploy-manage/security.md)
23+
- [Upgrade Elasticsearch](docs-content://deploy-manage/upgrade/deployment-or-cluster.md)
24+
- [Set up a cluster for high availability](docs-content://deploy-manage/tools.md)
25+
- [Stack monitoring](docs-content://deploy-manage/monitor/stack-monitoring.md)
26+
- [Troubleshooting](docs-content://troubleshoot/elasticsearch.md)
27+
- [Optimizations](docs-content://deploy-manage/production-guidance/optimize-performance.md)
28+
29+
## Working with data
30+
31+
- [Adding data to Elasticsearch](docs-content://manage-data/ingest.md)
32+
- [Connectors](https://www.elastic.co/docs/reference/search-connectors)
33+
- [Web crawler](https://www.elastic.co/search-labs/blog/elastic-open-crawler-release)
34+
- [Data streams](docs-content://manage-data/data-store/data-streams.md)
35+
- [Ingest pipelines](docs-content://manage-data/ingest/transform-enrich/ingest-pipelines.md)
36+
- [Mapping](docs-content://manage-data/data-store/mapping.md)
37+
- [Data management](docs-content://manage-data/lifecycle.md)
38+
- [Downsampling](docs-content://manage-data/lifecycle.md)
39+
- [Snapshot and restore](docs-content://deploy-manage/tools/snapshot-and-restore.md)
40+
41+
## Search and analytics
42+
43+
{{es}} is the search and analytics engine that powers the {{stack}}.
44+
45+
- [Get started](docs-content://get-started/index.md)
46+
- [Learn how to search your data](docs-content://solutions/search/querying-for-search.md)
47+
- Query data programmatically: use query languages to run advanced search, filtering, or analytics
48+
- [Query DSL](docs-content://explore-analyze/query-filter/languages/querydsl.md): full JSON-based query language
49+
- [ES|QL](docs-content://explore-analyze/query-filter/languages/esql.md): fast, SQL-like language with piped syntax
50+
- [EQL](docs-content://explore-analyze/query-filter/languages/eql.md): for event-based time series data, such as logs, metrics, and traces
51+
- [SQL](docs-content://explore-analyze/query-filter/languages/sql.md): SQL-style queries on Elasticsearch data
52+
- [Search applications](docs-content://solutions/search/search-applications.md)
53+
- [Aggregations](docs-content://explore-analyze/query-filter/aggregations.md)
54+
- [Geospatial analysis](docs-content://explore-analyze/geospatial-analysis.md)
55+
- [Machine Learning](docs-content://explore-analyze/machine-learning.md)
56+
- [Alerting](docs-content://explore-analyze/alerts-cases.md)
57+
58+
## APIs and developer docs
59+
60+
- [REST APIs](https://www.elastic.co/docs/reference/elasticsearch/rest-apis)
61+
- [{{es}} Clients](https://www.elastic.co/docs/reference/elasticsearch-clients)
62+
- [Painless](https://www.elastic.co/docs/reference/scripting-languages/painless/painless)
63+
- [Plugins and integrations](https://www.elastic.co/docs/reference/elasticsearch/plugins)
64+
- [Search Labs](https://www.elastic.co/search-labs)
65+
- [Notebook examples](https://www.elastic.co/search-labs/tutorials/examples)

docs/reference/query-languages/esql/_snippets/commands/layout/change_point.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
## `CHANGE_POINT` [esql-change_point]
2-
3-
:::{note}
4-
The `CHANGE_POINT` command requires a [platinum license](https://www.elastic.co/subscriptions).
5-
:::
6-
71
```yaml {applies_to}
82
serverless: preview
93
stack: preview 9.1.0
104
```
115
6+
:::{note}
7+
The `CHANGE_POINT` command requires a [platinum license](https://www.elastic.co/subscriptions).
8+
:::
9+
1210
`CHANGE_POINT` detects spikes, dips, and change points in a metric.
1311

1412
**Syntax**

docs/reference/query-languages/esql/_snippets/commands/layout/completion.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
## `COMPLETION` [esql-completion]
21

32
```yaml {applies_to}
43
serverless: preview

docs/reference/query-languages/esql/_snippets/commands/layout/dissect.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
## `DISSECT` [esql-dissect]
1+
```yaml {applies_to}
2+
serverless: ga
3+
stack: ga
4+
```
25
36
`DISSECT` enables you to [extract structured data out of a string](/reference/query-languages/esql/esql-process-data-with-dissect-grok.md).
47

docs/reference/query-languages/esql/_snippets/commands/layout/drop.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
## `DROP` [esql-drop]
1+
```yaml {applies_to}
2+
serverless: ga
3+
stack: ga
4+
```
25
36
The `DROP` processing command removes one or more columns.
47

0 commit comments

Comments
 (0)