Skip to content

Commit a4d8ac1

Browse files
authored
Merge branch 'main' into esql-function-auto-complete-hints
2 parents 4f10a02 + 5909e80 commit a4d8ac1

File tree

170 files changed

+6330
-1149
lines changed

Some content is hidden

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

170 files changed

+6330
-1149
lines changed

docs/changelog/138723.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
pr: 138723
2+
summary: Remove DOC_VALUES_SKIPPER feature flag
3+
area: Mapping
4+
type: feature
5+
issues: []
6+
highlight:
7+
title: Enable doc_values skippers
8+
body: |-
9+
Doc_values skippers add a sparse index to doc_values fields, allowing efficient
10+
querying and filtering on a field without having to build a separate BKD or terms
11+
index. These are now enabled automatically on any field configured with
12+
index=false and doc_values=true if the index setting `index.mapping.use_doc_values_skipper`
13+
is set to `true` (default `false`, or `true` for TSDB indexes).
14+
15+
TSDB indexes now default to using skippers in place of indexes for their
16+
@timestamp, dimension and _tsid fields, greatly reducing their on-disk
17+
footprint. To disable skippers in TSDB indexes, set `index.mapping.use_doc_values_skipper`
18+
to `false`.
19+
20+
notable: true

docs/changelog/138989.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 138989
2+
summary: Auto prefiltering for queries on dense `semantic_text` fields
3+
area: Vector Search
4+
type: bug
5+
issues: []

docs/changelog/139409.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 139409
2+
summary: Use new bulk scoring dot product for max inner product
3+
area: Vector Search
4+
type: enhancement
5+
issues: []

docs/changelog/139420.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 139420
2+
summary: Fix offset maths bug in `InetAddress` parsing
3+
area: Mapping
4+
type: bug
5+
issues: []

docs/reference/elasticsearch/index-settings/slow-log.md

Lines changed: 136 additions & 212 deletions
Large diffs are not rendered by default.

libs/simdvec/src/main21/java/org/elasticsearch/simdvec/internal/Int7SQVectorScorerSupplier.java

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,37 @@ float scoreFromSegments(MemorySegment a, float aOffset, MemorySegment b, float b
270270
return adjustedDistance + 1;
271271
}
272272

273+
@Override
274+
protected void bulkScoreFromSegment(
275+
MemorySegment vectors,
276+
int vectorLength,
277+
int vectorPitch,
278+
int firstOrd,
279+
MemorySegment ordinals,
280+
MemorySegment scores,
281+
int numNodes
282+
) {
283+
long firstByteOffset = (long) firstOrd * vectorPitch;
284+
var firstVector = vectors.asSlice(firstByteOffset, vectorPitch);
285+
Similarities.dotProduct7uBulkWithOffsets(vectors, firstVector, dims, vectorPitch, ordinals, numNodes, scores);
286+
287+
// Java-side adjustment
288+
var aOffset = Float.intBitsToFloat(
289+
vectors.asSlice(firstByteOffset + vectorLength, Float.BYTES).getAtIndex(ValueLayout.JAVA_INT_UNALIGNED, 0)
290+
);
291+
for (int i = 0; i < numNodes; ++i) {
292+
var dotProduct = scores.getAtIndex(ValueLayout.JAVA_FLOAT, i);
293+
var secondOrd = ordinals.getAtIndex(ValueLayout.JAVA_INT, i);
294+
long secondByteOffset = (long) secondOrd * vectorPitch;
295+
var bOffset = Float.intBitsToFloat(
296+
vectors.asSlice(secondByteOffset + vectorLength, Float.BYTES).getAtIndex(ValueLayout.JAVA_INT_UNALIGNED, 0)
297+
);
298+
float adjustedDistance = dotProduct * scoreCorrectionConstant + aOffset + bOffset;
299+
adjustedDistance = adjustedDistance < 0 ? 1 / (1 + -1 * adjustedDistance) : adjustedDistance + 1;
300+
scores.setAtIndex(ValueLayout.JAVA_FLOAT, i, adjustedDistance);
301+
}
302+
}
303+
273304
@Override
274305
public MaxInnerProductSupplier copy() {
275306
return new MaxInnerProductSupplier(input.clone(), values, scoreCorrectionConstant);

libs/simdvec/src/main22/java/org/elasticsearch/simdvec/internal/Int7SQVectorScorer.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,30 @@ public float score(int node) throws IOException {
168168
}
169169
return adjustedDistance + 1;
170170
}
171+
172+
@Override
173+
public void bulkScore(int[] nodes, float[] scores, int numNodes) throws IOException {
174+
MemorySegment vectorsSeg = input.segmentSliceOrNull(0, input.length());
175+
if (vectorsSeg == null) {
176+
super.bulkScore(nodes, scores, numNodes);
177+
} else {
178+
var ordinalsSeg = MemorySegment.ofArray(nodes);
179+
var scoresSeg = MemorySegment.ofArray(scores);
180+
181+
var vectorPitch = vectorByteSize + Float.BYTES;
182+
dotProduct7uBulkWithOffsets(vectorsSeg, query, vectorByteSize, vectorPitch, ordinalsSeg, numNodes, scoresSeg);
183+
184+
for (int i = 0; i < numNodes; ++i) {
185+
var dotProduct = scores[i];
186+
var secondOrd = nodes[i];
187+
long secondByteOffset = (long) secondOrd * vectorPitch;
188+
var nodeCorrection = Float.intBitsToFloat(input.readInt(secondByteOffset + vectorByteSize));
189+
float adjustedDistance = dotProduct * scoreCorrectionConstant + queryCorrection + nodeCorrection;
190+
adjustedDistance = adjustedDistance < 0 ? 1 / (1 + -1 * adjustedDistance) : adjustedDistance + 1;
191+
scores[i] = adjustedDistance;
192+
}
193+
}
194+
}
171195
}
172196

173197
static void checkDimensions(int queryLen, int fieldLen) {

0 commit comments

Comments
 (0)