Skip to content

Commit 52d9fb1

Browse files
committed
Merge branch 'main' into agg-metric-block
2 parents 09497b3 + feb44c5 commit 52d9fb1

File tree

63 files changed

+3888
-236
lines changed

Some content is hidden

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

63 files changed

+3888
-236
lines changed

docs/changelog/124708.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 124708
2+
summary: Throw exception for unknown token in RestIndexPutAliasAction
3+
area: Indices APIs
4+
type: enhancement
5+
issues: []

docs/changelog/124737.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 124737
2+
summary: Throw exception for unsupported values type in Alias
3+
area: Indices APIs
4+
type: enhancement
5+
issues: []

docs/changelog/127134.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 127134
2+
summary: Define a default oversample value for dense vectors with bbq_hnsw/bbq_flat
3+
area: Vector Search
4+
type: enhancement
5+
issues: []

docs/changelog/127139.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 127139
2+
summary: Add `suggested_cast`
3+
area: ES|QL
4+
type: enhancement
5+
issues: []

qa/smoke-test-http/src/internalClusterTest/java/org/elasticsearch/http/SearchRestCancellationIT.java

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
import org.apache.http.nio.entity.NByteArrayEntity;
1313
import org.apache.logging.log4j.LogManager;
1414
import org.apache.lucene.util.SetOnce;
15-
import org.elasticsearch.action.admin.cluster.node.info.NodeInfo;
16-
import org.elasticsearch.action.admin.cluster.node.info.NodesInfoResponse;
1715
import org.elasticsearch.action.admin.cluster.node.tasks.list.ListTasksResponse;
1816
import org.elasticsearch.action.bulk.BulkRequestBuilder;
1917
import org.elasticsearch.action.search.MultiSearchRequest;
@@ -46,7 +44,6 @@
4644
import java.util.ArrayList;
4745
import java.util.Collection;
4846
import java.util.Collections;
49-
import java.util.HashMap;
5047
import java.util.List;
5148
import java.util.Map;
5249
import java.util.concurrent.CancellationException;
@@ -94,7 +91,7 @@ public void testAutomaticCancellationMultiSearchDuringQueryPhase() throws Except
9491
}
9592

9693
void verifyCancellationDuringQueryPhase(String searchAction, Request searchRequest) throws Exception {
97-
Map<String, String> nodeIdToName = readNodesInfo();
94+
Map<String, String> nodeIdToName = nodeIdsToNames();
9895

9996
List<ScriptedBlockPlugin> plugins = initBlockFactory();
10097
indexTestData();
@@ -137,7 +134,7 @@ public void testAutomaticCancellationMultiSearchDuringFetchPhase() throws Except
137134
}
138135

139136
void verifyCancellationDuringFetchPhase(String searchAction, Request searchRequest) throws Exception {
140-
Map<String, String> nodeIdToName = readNodesInfo();
137+
Map<String, String> nodeIdToName = nodeIdsToNames();
141138

142139
List<ScriptedBlockPlugin> plugins = initBlockFactory();
143140
indexTestData();
@@ -153,16 +150,6 @@ void verifyCancellationDuringFetchPhase(String searchAction, Request searchReque
153150
expectThrows(CancellationException.class, future::actionGet);
154151
}
155152

156-
private static Map<String, String> readNodesInfo() {
157-
Map<String, String> nodeIdToName = new HashMap<>();
158-
NodesInfoResponse nodesInfoResponse = clusterAdmin().prepareNodesInfo().get();
159-
assertFalse(nodesInfoResponse.hasFailures());
160-
for (NodeInfo node : nodesInfoResponse.getNodes()) {
161-
nodeIdToName.put(node.getNode().getId(), node.getNode().getName());
162-
}
163-
return nodeIdToName;
164-
}
165-
166153
private static void ensureSearchTaskIsCancelled(String transportAction, Function<String, String> nodeIdToName) throws Exception {
167154
SetOnce<TaskInfo> searchTask = new SetOnce<>();
168155
ListTasksResponse listTasksResponse = clusterAdmin().prepareListTasks().get();

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/indices.create/10_basic.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,38 @@
8686
- is_false: test_index.aliases.test_clias.index_routing
8787
- is_false: test_index.aliases.test_clias.search_routing
8888

89+
---
90+
"Throw exception for unsupported value type":
91+
- requires:
92+
cluster_features: [ "index.throw_exception_on_index_creation_if_unsupported_value_type_in_alias" ]
93+
reason: "Throw exception on index creation if unsupported value type in alias"
94+
95+
- do:
96+
catch: /Unsupported String type value \[true\] for field \[is_write_index\] in alias \[test_alias\]/
97+
indices.create:
98+
index: test_index
99+
body:
100+
mappings:
101+
properties:
102+
field:
103+
type: text
104+
aliases:
105+
test_alias:
106+
is_write_index: "true"
107+
108+
- do:
109+
catch: /Unsupported boolean type value \[true\] for field \[routing\] in alias \[test_alias\]/
110+
indices.create:
111+
index: test_index
112+
body:
113+
mappings:
114+
properties:
115+
field:
116+
type: text
117+
aliases:
118+
test_alias:
119+
routing: true
120+
89121
---
90122
"Create index with write aliases":
91123

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/indices.put_alias/10_basic.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,30 @@
103103
index: test_index
104104
name: test_alias
105105
- match: {test_index.aliases.test_alias: {"filter": {"range": {"date_nanos_field": {"gt": "now-7d/d"}}}}}
106+
107+
---
108+
"Throw exception for unknown token":
109+
- requires:
110+
cluster_features: [ "index.throw_exception_for_unknown_token_in_rest_index_put_alias_action" ]
111+
reason: "Throw exception for unknown token in RestIndexPutAliasAction"
112+
113+
- do:
114+
indices.create:
115+
index: test_index
116+
117+
- do:
118+
catch: /Unsupported field \[foo\]/
119+
indices.put_alias:
120+
index: test_index
121+
name: test_alias
122+
body:
123+
is_write_index: true
124+
foo: "bar"
125+
126+
- do:
127+
catch: / Unexpected token \[START_ARRAY\]/
128+
indices.put_alias:
129+
index: test_index
130+
name: test_alias
131+
body:
132+
routing: [ "routing" ]

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search.vectors/41_knn_search_bbq_hnsw.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,3 +568,14 @@ setup:
568568
- match: { hits.hits.1._score: $default_rescore1 }
569569
- match: { hits.hits.2._score: $override_score2 }
570570
- match: { hits.hits.2._score: $default_rescore2 }
571+
572+
---
573+
"default oversample value":
574+
- requires:
575+
cluster_features: ["mapper.dense_vector.default_oversample_value_for_bbq"]
576+
reason: "Needs default_oversample_value_for_bbq feature"
577+
- do:
578+
indices.get_mapping:
579+
index: bbq_hnsw
580+
581+
- match: { bbq_hnsw.mappings.properties.vector.index_options.rescore_vector.oversample: 3.0 }

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search.vectors/42_knn_search_bbq_flat.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,3 +339,14 @@ setup:
339339
- match: { hits.hits.0._score: $rescore_score0 }
340340
- match: { hits.hits.1._score: $rescore_score1 }
341341
- match: { hits.hits.2._score: $rescore_score2 }
342+
343+
---
344+
"default oversample value":
345+
- requires:
346+
cluster_features: ["mapper.dense_vector.default_oversample_value_for_bbq"]
347+
reason: "Needs default_oversample_value_for_bbq feature"
348+
- do:
349+
indices.get_mapping:
350+
index: bbq_flat
351+
352+
- match: { bbq_flat.mappings.properties.vector.index_options.rescore_vector.oversample: 3.0 }

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search.vectors/42_knn_search_int4_flat.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,3 +495,14 @@ setup:
495495
- match: { hits.hits.0._score: $rescore_score0 }
496496
- match: { hits.hits.1._score: $rescore_score1 }
497497
- match: { hits.hits.2._score: $rescore_score2 }
498+
499+
---
500+
"no default oversample value":
501+
- requires:
502+
cluster_features: ["mapper.dense_vector.default_oversample_value_for_bbq"]
503+
reason: "Needs default_oversample_value_for_bbq feature"
504+
- do:
505+
indices.get_mapping:
506+
index: int4_flat
507+
508+
- not_exists: int4_flat.mappings.properties.vector.index_options.rescore_vector

0 commit comments

Comments
 (0)