Skip to content

Commit 53bbb34

Browse files
committed
Merge remote-tracking branch 'upstream/9.1' into backport/9.1/pr-130049
2 parents 1912d25 + 6e2bc78 commit 53bbb34

File tree

7 files changed

+46
-6
lines changed

7 files changed

+46
-6
lines changed

.buildkite/scripts/run-bc-upgrade-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ select(.active_release == true) |
2424
(.build_candidates | to_entries | sort_by(.value.completed_at))) |
2525
last | .value.manifest_url")"
2626

27-
if [[ -z "$MANIFEST_URL" ]]; then
27+
if [[ -z "$MANIFEST_URL" ]] || [[ "$MANIFEST_URL" == "null" ]]; then
2828
echo "No snapshots or build candidates for branch [$BUILDKITE_BRANCH]."
2929
echo "Skipping BC upgrade tests."
3030
exit 0

.buildkite/scripts/run-pr-upgrade-tests.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ fi
1818

1919
# Identify the merge base of the current commit (branch) and the base branch of the pull request.
2020
# PR upgrade tests are run from the merge base to the current commit.
21-
BASE_COMMIT=$(git merge-base $BUILDKITE_PULL_REQUEST_BASE_BRANCH $BUILDKITE_COMMIT)
21+
git fetch origin $BUILDKITE_PULL_REQUEST_BASE_BRANCH
22+
BASE_COMMIT=$(git merge-base origin/$BUILDKITE_PULL_REQUEST_BASE_BRANCH $BUILDKITE_COMMIT)
2223

2324
VERSION=$(sed -n 's/^elasticsearch[[:space:]]*=[[:space:]]*\(.*\)/\1/p' build-tools-internal/version.properties)
2425

docs/reference/query-languages/query-dsl/query-dsl-knn-query.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,36 @@ A sample query can look like below:
229229

230230
Note that nested `knn` only supports `score_mode=max`.
231231

232+
## Knn query on a semantic_text field [knn-query-with-semantic-text]
233+
234+
Elasticsearch supports knn queries over a [
235+
`semantic_text` field](/reference/elasticsearch/mapping-reference/semantic-text.md).
236+
237+
Here is an example using the `query_vector_builder`:
238+
239+
```json
240+
{
241+
"query": {
242+
"knn": {
243+
"field": "inference_field",
244+
"k": 10,
245+
"num_candidates": 100,
246+
"query_vector_builder": {
247+
"text_embedding": {
248+
"model_text": "test"
249+
}
250+
}
251+
}
252+
}
253+
}
254+
```
255+
256+
Note that for `semantic_text` fields, the `model_id` does not have to be
257+
provided as it can be inferred from the `semantic_text` field mapping.
258+
259+
Knn search using query vectors over `semantic_text` fields is also supported,
260+
with no change to the API.
261+
232262
## Knn query with aggregations [knn-query-aggregations]
233263

234264
`knn` query calculates aggregations on top `k` documents from each shard. Thus, the final results from aggregations contain `k * number_of_shards` documents. This is different from the [top level knn section](docs-content://solutions/search/vector/knn.md) where aggregations are calculated on the global top `k` nearest documents.

muted-tests.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,8 +561,6 @@ tests:
561561
- class: org.elasticsearch.xpack.inference.qa.mixed.CohereServiceMixedIT
562562
method: testCohereEmbeddings
563563
issue: https://github.com/elastic/elasticsearch/issues/130010
564-
- class: org.elasticsearch.xpack.esql.qa.mixed.MixedClusterEsqlSpecIT
565-
issue: https://github.com/elastic/elasticsearch/issues/128224
566564
- class: org.elasticsearch.cluster.metadata.ComposableIndexTemplateTests
567565
method: testMergeEmptyMappingsIntoTemplateWithNonEmptySettings
568566
issue: https://github.com/elastic/elasticsearch/issues/130050
@@ -574,6 +572,9 @@ tests:
574572
- class: org.elasticsearch.xpack.esql.qa.single_node.GenerativeIT
575573
method: test
576574
issue: https://github.com/elastic/elasticsearch/issues/130067
575+
- class: org.elasticsearch.compute.operator.topn.TopNOperatorTests
576+
method: testSimpleWithCranky
577+
issue: https://github.com/elastic/elasticsearch/issues/130215
577578

578579
# Examples:
579580
#

x-pack/plugin/esql/qa/testFixtures/src/main/resources/mapping-colors.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
"type": "dense_vector",
1414
"similarity": "l2_norm",
1515
"index_options": {
16-
"type": "hnsw"
16+
"type": "hnsw",
17+
"m": 16,
18+
"ef_construction": 100
1719
}
1820
}
1921
}

x-pack/plugin/esql/qa/testFixtures/src/main/resources/mapping-dense_vector.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@
55
},
66
"vector": {
77
"type": "dense_vector",
8-
"similarity": "l2_norm"
8+
"similarity": "l2_norm",
9+
"index_options": {
10+
"type": "hnsw",
11+
"m": 16,
12+
"ef_construction": 100
13+
}
914
}
1015
}
1116
}

x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action/EsqlActionIT.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1680,6 +1680,7 @@ public void testQueryOnEmptyDataIndex() {
16801680
}
16811681

16821682
public void testGroupingStatsOnMissingFields() {
1683+
assumeTrue("Pragmas are only allowed in snapshots", Build.current().isSnapshot());
16831684
assertAcked(client().admin().indices().prepareCreate("missing_field_index").setMapping("data", "type=long"));
16841685
long oneValue = between(1, 1000);
16851686
indexDoc("missing_field_index", "1", "data", oneValue);

0 commit comments

Comments
 (0)