Skip to content

Commit c905bda

Browse files
authored
Merge branch 'main' into upgrade_netty_4.1.126.Final
2 parents 77ebbaf + 1a49be5 commit c905bda

File tree

18 files changed

+392
-88
lines changed

18 files changed

+392
-88
lines changed
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
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.vector;
11+
12+
import org.elasticsearch.common.logging.LogConfigurator;
13+
import org.elasticsearch.index.codec.vectors.cluster.NeighborHood;
14+
import org.openjdk.jmh.annotations.Benchmark;
15+
import org.openjdk.jmh.annotations.BenchmarkMode;
16+
import org.openjdk.jmh.annotations.Fork;
17+
import org.openjdk.jmh.annotations.Measurement;
18+
import org.openjdk.jmh.annotations.Mode;
19+
import org.openjdk.jmh.annotations.OutputTimeUnit;
20+
import org.openjdk.jmh.annotations.Param;
21+
import org.openjdk.jmh.annotations.Scope;
22+
import org.openjdk.jmh.annotations.Setup;
23+
import org.openjdk.jmh.annotations.State;
24+
import org.openjdk.jmh.annotations.Warmup;
25+
import org.openjdk.jmh.infra.Blackhole;
26+
27+
import java.io.IOException;
28+
import java.util.Random;
29+
import java.util.concurrent.TimeUnit;
30+
31+
@BenchmarkMode(Mode.AverageTime)
32+
@OutputTimeUnit(TimeUnit.SECONDS)
33+
@State(Scope.Benchmark)
34+
// first iteration is complete garbage, so make sure we really warmup
35+
@Warmup(iterations = 1, time = 1)
36+
// real iterations. not useful to spend tons of time here, better to fork more
37+
@Measurement(iterations = 3, time = 1)
38+
// engage some noise reduction
39+
@Fork(value = 1)
40+
public class ComputeNeighboursBenchmark {
41+
42+
static {
43+
LogConfigurator.configureESLogging(); // native access requires logging to be initialized
44+
}
45+
46+
@Param({ "1000", "2000", "3000", "5000", "10000", "20000", "50000" })
47+
int numVectors;
48+
49+
@Param({ "384", "782", "1024" })
50+
int dims;
51+
52+
float[][] vectors;
53+
int clusterPerNeighbour = 128;
54+
55+
@Setup
56+
public void setup() throws IOException {
57+
Random random = new Random(123);
58+
vectors = new float[numVectors][dims];
59+
for (float[] vector : vectors) {
60+
for (int i = 0; i < dims; i++) {
61+
vector[i] = random.nextFloat();
62+
}
63+
}
64+
}
65+
66+
@Benchmark
67+
@Fork(jvmArgsPrepend = { "--add-modules=jdk.incubator.vector" })
68+
public void bruteForce(Blackhole bh) {
69+
bh.consume(NeighborHood.computeNeighborhoodsBruteForce(vectors, clusterPerNeighbour));
70+
}
71+
72+
@Benchmark
73+
@Fork(jvmArgsPrepend = { "--add-modules=jdk.incubator.vector" })
74+
public void graph(Blackhole bh) throws IOException {
75+
bh.consume(NeighborHood.computeNeighborhoodsGraph(vectors, clusterPerNeighbour));
76+
}
77+
}

docs/reference/elasticsearch/mapping-reference/doc-values.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,13 @@ PUT my-index-000001
7373
1. The `status_code` field has `doc_values` enabled by default.
7474
2. The `session_id` has `doc_values` disabled, but can still be queried.
7575

76+
## Multi-valued doc values note
77+
78+
Elasticsearch supports storing multi-valued fields at index time. Multi-valued fields can be provided as a json array. However in the doc values format, the values aren't stored in the order as was provided at index time. Additionally, duplicates may be lost.
79+
This implementation detail of doc values is visible when features directly interact with doc values, which may be the case for example in ES|QL or aggregations in the search API. Note, that _source always returns arrays in the way that was provided at index time.
80+
81+
How the ordering differs depends on whether the array is mapped as keyword or a numeric field type. In case of the `keyword` field type, the multi-valued values for each document are ordered lexicographically and duplicates are lost. If retaining duplicates is important then the `counted_keyword` field type should be used.
82+
In case of numeric field types (e.g. `long`, `double`, `scaled_float`, etc.), the multi-valued values for each document are ordered in natural order and duplicates are retained.
7683

7784

7885

rest-api-spec/src/main/resources/rest-api-spec/api/indices.cancel_migrate_reindex.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"url":"https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-cancel-migrate-reindex",
55
"description":"Cancel a migration reindex operation"
66
},
7-
"stability":"experimental",
8-
"visibility":"private",
7+
"stability":"stable",
8+
"visibility":"public",
99
"headers":{
1010
"accept": [ "application/json"],
1111
"content_type": ["application/json"]

rest-api-spec/src/main/resources/rest-api-spec/api/indices.create_from.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"url":"https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-create-from",
55
"description":"Create an index from a source index"
66
},
7-
"stability":"experimental",
8-
"visibility":"private",
7+
"stability":"stable",
8+
"visibility":"public",
99
"headers":{
1010
"accept": [ "application/json"],
1111
"content_type": ["application/json"]

rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_migrate_reindex_status.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"url":"https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-migration",
55
"description":"Get the migration reindexing status"
66
},
7-
"stability":"experimental",
8-
"visibility":"private",
7+
"stability":"stable",
8+
"visibility":"public",
99
"headers":{
1010
"accept": [ "application/json"],
1111
"content_type": ["application/json"]

rest-api-spec/src/main/resources/rest-api-spec/api/indices.migrate_reindex.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"url":"https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-migrate-reindex",
55
"description":"Reindex legacy backing indices"
66
},
7-
"stability":"experimental",
8-
"visibility":"private",
7+
"stability":"stable",
8+
"visibility":"public",
99
"headers":{
1010
"accept": [ "application/json"],
1111
"content_type": ["application/json"]

rest-api-spec/src/main/resources/rest-api-spec/api/query_rules.test.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"url": "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-query-rules-test",
55
"description": "Test a query ruleset"
66
},
7-
"stability": "experimental",
7+
"stability": "stable",
88
"visibility": "public",
99
"headers": {
1010
"accept": [

rest-api-spec/src/main/resources/rest-api-spec/api/security.activate_user_profile.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"description":"Activate a user profile"
66
},
77
"stability":"stable",
8-
"visibility":"private",
8+
"visibility":"public",
99
"headers":{
1010
"accept": [ "application/json"],
1111
"content_type": ["application/json"]

rest-api-spec/src/main/resources/rest-api-spec/api/security.disable_user_profile.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"description":"Disable a user profile"
66
},
77
"stability":"stable",
8-
"visibility":"private",
8+
"visibility":"public",
99
"headers":{
1010
"accept": [ "application/json"]
1111
},

rest-api-spec/src/main/resources/rest-api-spec/api/security.enable_user_profile.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"description":"Enable a user profile"
66
},
77
"stability":"stable",
8-
"visibility":"private",
8+
"visibility":"public",
99
"headers":{
1010
"accept": [ "application/json"]
1111
},

0 commit comments

Comments
 (0)