Skip to content

Commit

Permalink
Merge branch 'main' into feature/add-hamming-script-function
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine committed Jun 17, 2024
2 parents d639369 + 9d6ef83 commit 45d10f0
Show file tree
Hide file tree
Showing 251 changed files with 5,312 additions and 1,048 deletions.
2 changes: 1 addition & 1 deletion benchmarks/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ dependencies {
api(project(':x-pack:plugin:esql-core'))
api(project(':x-pack:plugin:esql'))
api(project(':x-pack:plugin:esql:compute'))
implementation project(path: ':libs:elasticsearch-vec')
implementation project(path: ':libs:elasticsearch-simdvec')
expression(project(path: ':modules:lang-expression', configuration: 'zip'))
painless(project(path: ':modules:lang-painless', configuration: 'zip'))
api "org.openjdk.jmh:jmh-core:$versions.jmh"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import org.apache.lucene.util.quantization.ScalarQuantizer;
import org.elasticsearch.common.logging.LogConfigurator;
import org.elasticsearch.core.IOUtils;
import org.elasticsearch.vec.VectorScorerFactory;
import org.elasticsearch.simdvec.VectorScorerFactory;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.Fork;
Expand All @@ -41,8 +41,8 @@
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.TimeUnit;

import static org.elasticsearch.vec.VectorSimilarityType.DOT_PRODUCT;
import static org.elasticsearch.vec.VectorSimilarityType.EUCLIDEAN;
import static org.elasticsearch.simdvec.VectorSimilarityType.DOT_PRODUCT;
import static org.elasticsearch.simdvec.VectorSimilarityType.EUCLIDEAN;

@Fork(value = 1, jvmArgsPrepend = { "--add-modules=jdk.incubator.vector" })
@Warmup(iterations = 3, time = 3)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ public class InternalDistributionModuleCheckTaskProvider {
"org.elasticsearch.preallocate",
"org.elasticsearch.securesm",
"org.elasticsearch.server",
"org.elasticsearch.simdvec",
"org.elasticsearch.tdigest",
"org.elasticsearch.vec",
"org.elasticsearch.xcontent"
);

Expand Down
6 changes: 6 additions & 0 deletions docs/changelog/109025.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pr: 109025
summary: Introduce a setting controlling the activation of the `logs` index mode in logs@settings
area: Logs
type: feature
issues:
- 108762
6 changes: 6 additions & 0 deletions docs/changelog/109462.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pr: 109462
summary: Add `wait_for_completion` parameter to delete snapshot request
area: Distributed
type: enhancement
issues:
- 101300
5 changes: 5 additions & 0 deletions docs/changelog/109480.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 109480
summary: "[Connector API] Add claim sync job endpoint"
area: Application
type: feature
issues: []
5 changes: 5 additions & 0 deletions docs/changelog/109634.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 109634
summary: "[Query Rules] Require Enterprise License for Query Rules"
area: Relevance
type: enhancement
issues: []
5 changes: 5 additions & 0 deletions docs/changelog/109672.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 109672
summary: Log repo UUID at generation/registration time
area: Snapshot/Restore
type: enhancement
issues: []
5 changes: 5 additions & 0 deletions docs/changelog/109695.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 109695
summary: Fix ESQL cancellation for exchange requests
area: ES|QL
type: bug
issues: []
5 changes: 5 additions & 0 deletions docs/changelog/109720.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 109720
summary: "DocsStats: Add human readable bytesize"
area: Stats
type: enhancement
issues: []
6 changes: 6 additions & 0 deletions docs/changelog/109746.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pr: 109746
summary: ES|QL Add primitive float support to the Compute Engine
area: ES|QL
type: enhancement
issues:
- 109178
5 changes: 5 additions & 0 deletions docs/reference/cluster/stats.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,10 @@ space of deleted Lucene documents when a segment is merged.
`total_size_in_bytes`::
(integer)
Total size in bytes across all primary shards assigned to selected nodes.

`total_size`::
(string)
Total size across all primary shards assigned to selected nodes, as a human-readable string.
=====
`store`::
Expand Down Expand Up @@ -1599,6 +1603,7 @@ The API returns the following response:
"docs": {
"count": 10,
"deleted": 0,
"total_size": "8.6kb",
"total_size_in_bytes": 8833
},
"store": {
Expand Down
3 changes: 3 additions & 0 deletions docs/reference/esql/functions/binary.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ include::types/mul.asciidoc[]
[.text-center]
image::esql/functions/signature/div.svg[Embedded,opts=inline]

NOTE: Division of two integer types will yield an integer result, rounding towards 0.
If you need floating point division, <<esql-cast-operator>> one of the arguments to a `DOUBLE`.

include::types/div.asciidoc[]

==== Modulus `%`
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/modules/discovery/quorums.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ succeeded on receipt of responses from a _quorum_, which is a subset of the
master-eligible nodes in the cluster. The advantage of requiring only a subset
of the nodes to respond is that it means some of the nodes can fail without
preventing the cluster from making progress. The quorums are carefully chosen so
the cluster does not have a "{wikipedia}/Split-brain_(computing)[split-brain]" scenario where it's partitioned into
the cluster does not have a "split brain" scenario where it's partitioned into
two pieces such that each piece may make decisions that are inconsistent with
those of the other piece.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ Comma-separated list of snapshot names to delete. Also accepts wildcards (`*`).

include::{es-ref-dir}/rest-api/common-parms.asciidoc[tag=master-timeout]

`wait_for_completion`::
(Optional, Boolean) If `true`, the request returns a response when the matching
snapshots are all deleted. If `false`, the request returns a response as soon as
the deletes are scheduled. Defaults to `true`.

[[delete-snapshot-api-example]]
==== {api-example-title}

Expand Down
4 changes: 2 additions & 2 deletions libs/native/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
to
org.elasticsearch.nativeaccess.jna,
org.elasticsearch.server,
org.elasticsearch.systemd,
org.elasticsearch.vec;
org.elasticsearch.simdvec,
org.elasticsearch.systemd;
// allows jna to implement a library provider, and ProviderLocator to load it
exports org.elasticsearch.nativeaccess.lib to org.elasticsearch.nativeaccess.jna, org.elasticsearch.base;

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
* Side Public License, v 1.
*/

module org.elasticsearch.vec {
module org.elasticsearch.simdvec {
requires org.elasticsearch.nativeaccess;
requires org.apache.lucene.core;

exports org.elasticsearch.vec to org.elasticsearch.server;
exports org.elasticsearch.simdvec to org.elasticsearch.server;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

package org.elasticsearch.vec;
package org.elasticsearch.simdvec;

import org.apache.lucene.index.VectorSimilarityFunction;
import org.apache.lucene.store.IndexInput;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

package org.elasticsearch.vec;
package org.elasticsearch.simdvec;

import org.apache.lucene.index.VectorSimilarityFunction;
import org.apache.lucene.store.IndexInput;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

package org.elasticsearch.vec;
package org.elasticsearch.simdvec;

import org.apache.lucene.index.VectorSimilarityFunction;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

package org.elasticsearch.vec;
package org.elasticsearch.simdvec;

import org.apache.lucene.index.VectorSimilarityFunction;
import org.apache.lucene.store.FilterIndexInput;
Expand All @@ -16,10 +16,10 @@
import org.apache.lucene.util.hnsw.RandomVectorScorerSupplier;
import org.apache.lucene.util.quantization.RandomAccessQuantizedByteVectorValues;
import org.elasticsearch.nativeaccess.NativeAccess;
import org.elasticsearch.vec.internal.Int7SQVectorScorer;
import org.elasticsearch.vec.internal.Int7SQVectorScorerSupplier.DotProductSupplier;
import org.elasticsearch.vec.internal.Int7SQVectorScorerSupplier.EuclideanSupplier;
import org.elasticsearch.vec.internal.Int7SQVectorScorerSupplier.MaxInnerProductSupplier;
import org.elasticsearch.simdvec.internal.Int7SQVectorScorer;
import org.elasticsearch.simdvec.internal.Int7SQVectorScorerSupplier.DotProductSupplier;
import org.elasticsearch.simdvec.internal.Int7SQVectorScorerSupplier.EuclideanSupplier;
import org.elasticsearch.simdvec.internal.Int7SQVectorScorerSupplier.MaxInnerProductSupplier;

import java.util.Optional;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

package org.elasticsearch.vec.internal;
package org.elasticsearch.simdvec.internal;

import org.apache.lucene.index.VectorSimilarityFunction;
import org.apache.lucene.util.hnsw.RandomVectorScorer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

package org.elasticsearch.vec.internal;
package org.elasticsearch.simdvec.internal;

import org.apache.lucene.store.MemorySegmentAccessInput;
import org.apache.lucene.util.hnsw.RandomVectorScorer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

package org.elasticsearch.vec.internal;
package org.elasticsearch.simdvec.internal;

import org.elasticsearch.nativeaccess.NativeAccess;
import org.elasticsearch.nativeaccess.VectorSimilarityFunctions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

package org.elasticsearch.vec.internal;
package org.elasticsearch.simdvec.internal;

import org.apache.lucene.codecs.hnsw.ScalarQuantizedVectorScorer;
import org.apache.lucene.index.VectorSimilarityFunction;
Expand All @@ -21,8 +21,8 @@
import java.lang.foreign.MemorySegment;
import java.util.Optional;

import static org.elasticsearch.vec.internal.Similarities.dotProduct7u;
import static org.elasticsearch.vec.internal.Similarities.squareDistance7u;
import static org.elasticsearch.simdvec.internal.Similarities.dotProduct7u;
import static org.elasticsearch.simdvec.internal.Similarities.squareDistance7u;

public abstract sealed class Int7SQVectorScorer extends RandomVectorScorer.AbstractRandomVectorScorer {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

package org.elasticsearch.vec;
package org.elasticsearch.simdvec;

import org.apache.lucene.util.quantization.ScalarQuantizedVectorSimilarity;
import org.elasticsearch.test.ESTestCase;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

package org.elasticsearch.vec;
package org.elasticsearch.simdvec;

import com.carrotsearch.randomizedtesting.generators.RandomNumbers;

Expand Down Expand Up @@ -38,11 +38,11 @@
import java.util.stream.IntStream;

import static org.apache.lucene.codecs.hnsw.ScalarQuantizedVectorScorer.quantizeQuery;
import static org.elasticsearch.simdvec.VectorSimilarityType.COSINE;
import static org.elasticsearch.simdvec.VectorSimilarityType.DOT_PRODUCT;
import static org.elasticsearch.simdvec.VectorSimilarityType.EUCLIDEAN;
import static org.elasticsearch.simdvec.VectorSimilarityType.MAXIMUM_INNER_PRODUCT;
import static org.elasticsearch.test.hamcrest.OptionalMatchers.isEmpty;
import static org.elasticsearch.vec.VectorSimilarityType.COSINE;
import static org.elasticsearch.vec.VectorSimilarityType.DOT_PRODUCT;
import static org.elasticsearch.vec.VectorSimilarityType.EUCLIDEAN;
import static org.elasticsearch.vec.VectorSimilarityType.MAXIMUM_INNER_PRODUCT;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.greaterThanOrEqualTo;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public class LogsDataStreamIT extends ESSingleNodeTestCase {
"@timestamp" : {
"type": "date"
},
"hostname": {
"host.name": {
"type": "keyword"
},
"pid": {
Expand All @@ -86,7 +86,7 @@ public class LogsDataStreamIT extends ESSingleNodeTestCase {
"@timestamp" : {
"type": "date"
},
"hostname": {
"host.name": {
"type": "keyword",
"time_series_dimension": "true"
},
Expand All @@ -110,7 +110,7 @@ public class LogsDataStreamIT extends ESSingleNodeTestCase {
private static final String LOG_DOC_TEMPLATE = """
{
"@timestamp": "%s",
"hostname": "%s",
"host.name": "%s",
"pid": "%d",
"method": "%s",
"message": "%s",
Expand All @@ -121,7 +121,7 @@ public class LogsDataStreamIT extends ESSingleNodeTestCase {
private static final String TIME_SERIES_DOC_TEMPLATE = """
{
"@timestamp": "%s",
"hostname": "%s",
"host.name": "%s",
"pid": "%d",
"method": "%s",
"ip_address": "%s",
Expand Down Expand Up @@ -207,7 +207,7 @@ public void testIndexModeLogsAndTimeSeriesSwitching() throws IOException, Execut
final String dataStreamName = generateDataStreamName("custom");
final List<String> indexPatterns = List.of("custom-*-*");
final Map<String, String> logsSettings = Map.of("index.mode", "logs");
final Map<String, String> timeSeriesSettings = Map.of("index.mode", "time_series", "index.routing_path", "hostname");
final Map<String, String> timeSeriesSettings = Map.of("index.mode", "time_series", "index.routing_path", "host.name");

putComposableIndexTemplate(client(), "custom-composable-template", LOGS_OR_STANDARD_MAPPING, logsSettings, indexPatterns);
createDataStream(client(), dataStreamName);
Expand All @@ -224,7 +224,7 @@ public void testIndexModeLogsAndTimeSeriesSwitching() throws IOException, Execut
assertDataStreamBackingIndicesModes(dataStreamName, List.of(IndexMode.LOGS, IndexMode.TIME_SERIES, IndexMode.LOGS));
}

public void testInvalidIndexModeTimeSeriesSwitchWithoutROutingPath() throws IOException, ExecutionException, InterruptedException {
public void testInvalidIndexModeTimeSeriesSwitchWithoutRoutingPath() throws IOException, ExecutionException, InterruptedException {
final String dataStreamName = generateDataStreamName("custom");
final List<String> indexPatterns = List.of("custom-*-*");
final Map<String, String> logsSettings = Map.of("index.mode", "logs");
Expand All @@ -250,7 +250,7 @@ public void testInvalidIndexModeTimeSeriesSwitchWithoutDimensions() throws IOExc
final String dataStreamName = generateDataStreamName("custom");
final List<String> indexPatterns = List.of("custom-*-*");
final Map<String, String> logsSettings = Map.of("index.mode", "logs");
final Map<String, String> timeSeriesSettings = Map.of("index.mode", "time_series", "index.routing_path", "hostname");
final Map<String, String> timeSeriesSettings = Map.of("index.mode", "time_series", "index.routing_path", "host.name");

putComposableIndexTemplate(client(), "custom-composable-template", LOGS_OR_STANDARD_MAPPING, logsSettings, indexPatterns);
createDataStream(client(), dataStreamName);
Expand All @@ -269,8 +269,9 @@ public void testInvalidIndexModeTimeSeriesSwitchWithoutDimensions() throws IOExc
assertThat(
exception.getCause().getCause().getMessage(),
Matchers.equalTo(
"All fields that match routing_path must be configured with [time_series_dimension: true] or flattened fields with "
+ "a list of dimensions in [time_series_dimensions] and without the [script] parameter. [hostname] was not a dimension."
"All fields that match routing_path must be configured with [time_series_dimension: true] or flattened fields "
+ "with a list of dimensions in [time_series_dimensions] and without the [script] parameter. [host.name] was not a "
+ "dimension."
)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ private static void waitForLogs(RestClient client) throws Exception {
"@timestamp" : {
"type": "date"
},
"hostname": {
"host.name": {
"type": "keyword"
},
"pid": {
Expand Down Expand Up @@ -116,7 +116,7 @@ private static void waitForLogs(RestClient client) throws Exception {
"@timestamp" : {
"type": "date"
},
"hostname": {
"host.name": {
"type": "keyword",
"time_series_dimension": "true"
},
Expand All @@ -138,7 +138,7 @@ private static void waitForLogs(RestClient client) throws Exception {
private static final String DOC_TEMPLATE = """
{
"@timestamp": "%s",
"hostname": "%s",
"host.name": "%s",
"pid": "%d",
"method": "%s",
"message": "%s",
Expand Down
Loading

0 comments on commit 45d10f0

Please sign in to comment.