Skip to content

Commit dee9adc

Browse files
Merge branch 'main' into es-132135-fix
2 parents 7ee98f7 + aa58fc7 commit dee9adc

File tree

117 files changed

+4289
-3114
lines changed

Some content is hidden

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

117 files changed

+4289
-3114
lines changed

build-tools/src/main/java/org/elasticsearch/gradle/test/TestBuildInfoPlugin.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,9 @@ public void apply(Project project) {
5757
task.into("META-INF", copy -> copy.from(testBuildInfoTask));
5858
});
5959

60-
if (project.getRootProject().getName().equals("elasticsearch")) {
61-
project.getTasks()
62-
.withType(Test.class)
63-
.matching(test -> List.of("test", "internalClusterTest").contains(test.getName()))
64-
.configureEach(test -> {
65-
test.systemProperty("es.entitlement.enableForTests", "true");
66-
});
67-
}
60+
project.getTasks()
61+
.withType(Test.class)
62+
.matching(test -> List.of("test", "internalClusterTest").contains(test.getName()))
63+
.configureEach(test -> test.getSystemProperties().putIfAbsent("es.entitlement.enableForTests", "true"));
6864
}
6965
}

distribution/docker/src/docker/iron_bank/hardening_manifest.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ tags:
1111
# Build args passed to Dockerfile ARGs
1212
args:
1313
BASE_IMAGE: "redhat/ubi/ubi9"
14-
BASE_TAG: "9.5"
14+
BASE_TAG: "9.6"
1515
# Docker image labels
1616
labels:
1717
org.opencontainers.image.title: "elasticsearch"

docs/changelog/113949.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
pr: 113949
2+
summary: Support kNN filter on nested metadata
3+
area: Vector Search
4+
type: enhancement
5+
issues:
6+
- 128803
7+
- 106994

docs/changelog/129662.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 129662
2+
summary: "[Security] Add entity store and asset criticality index privileges to built\
3+
\ in Editor, Viewer and Kibana System roles"
4+
area: Authorization
5+
type: enhancement
6+
issues: []

docs/changelog/131517.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 131517
2+
summary: Refresh potential lost connections at query start for field caps
3+
area: Search
4+
type: enhancement
5+
issues: []

docs/changelog/131937.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 131937
2+
summary: Fix race condition in `RemoteClusterService.collectNodes()`
3+
area: Distributed
4+
type: bug
5+
issues: []

docs/changelog/132101.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 132101
2+
summary: Simulate ingest API uses existing index mapping when `mapping_addition` is
3+
given
4+
area: Ingest Node
5+
type: bug
6+
issues: []

docs/reference/elasticsearch/mapping-reference/semantic-text.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ the embedding generation, indexing, and query to use.
3737
[quantized](/reference/elasticsearch/mapping-reference/dense-vector.md#dense-vector-quantization)
3838
to `bbq_hnsw` automatically.
3939

40+
## Default and custom endpoints
41+
42+
You can use either preconfigured endpoints in your `semantic_text` fields which
43+
are ideal for most use cases or create custom endpoints and reference them in
44+
the field mappings.
45+
46+
### Using the default ELSER endpoint
47+
4048
If you use the preconfigured `.elser-2-elasticsearch` endpoint, you can set up
4149
`semantic_text` with the following API request:
4250

@@ -53,6 +61,8 @@ PUT my-index-000001
5361
}
5462
```
5563

64+
### Using a custom endpoint
65+
5666
To use a custom {{infer}} endpoint instead of the default
5767
`.elser-2-elasticsearch`, you
5868
must [Create {{infer}} API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put)
@@ -96,6 +106,35 @@ PUT my-index-000003
96106
}
97107
```
98108

109+
### Using ELSER on EIS
110+
111+
```{applies_to}
112+
stack: preview 9.1
113+
serverless: preview
114+
```
115+
116+
If you use the preconfigured `.elser-2-elastic` endpoint that utilizes the ELSER model as a service through the Elastic Inference Service ([ELSER on EIS](docs-content://explore-analyze/elastic-inference/eis.md#elser-on-eis)), you can
117+
set up `semantic_text` with the following API request:
118+
119+
```console
120+
PUT my-index-000001
121+
{
122+
"mappings": {
123+
"properties": {
124+
"inference_field": {
125+
"type": "semantic_text",
126+
"inference_id": ".elser-2-elastic"
127+
}
128+
}
129+
}
130+
}
131+
```
132+
133+
::::{note}
134+
While we do encourage experimentation, we do not recommend implementing production use cases on top of this feature while it is in Technical Preview.
135+
136+
::::
137+
99138
## Parameters for `semantic_text` fields [semantic-text-params]
100139

101140
`inference_id`

docs/reference/query-languages/esql/_snippets/commands/layout/completion.md

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,26 @@ The `COMPLETION` command allows you to send prompts and context to a Large Langu
99

1010
**Syntax**
1111

12+
::::{tab-set}
13+
14+
:::{tab-item} 9.2.0+
15+
1216
```esql
13-
COMPLETION [column =] prompt WITH inference_id
17+
COMPLETION [column =] prompt WITH { "inference_id" : "my_inference_endpoint" }
1418
```
1519

20+
:::
21+
22+
:::{tab-item} 9.1.x only
23+
24+
```esql
25+
COMPLETION [column =] prompt WITH my_inference_endpoint
26+
```
27+
28+
:::
29+
30+
::::
31+
1632
**Parameters**
1733

1834
`column`
@@ -24,7 +40,7 @@ COMPLETION [column =] prompt WITH inference_id
2440
: The input text or expression used to prompt the LLM.
2541
This can be a string literal or a reference to a column containing text.
2642

27-
`inference_id`
43+
`my_inference_endpoint`
2844
: The ID of the [inference endpoint](docs-content://explore-analyze/elastic-inference/inference-api.md) to use for the task.
2945
The inference endpoint must be configured with the `completion` task type.
3046

@@ -75,7 +91,7 @@ How you increase the timeout depends on your deployment type:
7591
If you don't want to increase the timeout limit, try the following:
7692

7793
* Reduce data volume with `LIMIT` or more selective filters before the `COMPLETION` command
78-
* Split complex operations into multiple simpler queries
94+
* Split complex operations into multiple simpler queries
7995
* Configure your HTTP client's response timeout (Refer to [HTTP client configuration](/reference/elasticsearch/configuration-reference/networking-settings.md#_http_client_configuration))
8096

8197

@@ -85,7 +101,7 @@ Use the default column name (results stored in `completion` column):
85101

86102
```esql
87103
ROW question = "What is Elasticsearch?"
88-
| COMPLETION question WITH test_completion_model
104+
| COMPLETION question WITH { "inference_id" : "my_inference_endpoint" }
89105
| KEEP question, completion
90106
```
91107

@@ -97,7 +113,7 @@ Specify the output column (results stored in `answer` column):
97113

98114
```esql
99115
ROW question = "What is Elasticsearch?"
100-
| COMPLETION answer = question WITH test_completion_model
116+
| COMPLETION answer = question WITH { "inference_id" : "my_inference_endpoint" }
101117
| KEEP question, answer
102118
```
103119

@@ -117,7 +133,7 @@ FROM movies
117133
"Synopsis: ", synopsis, "\n",
118134
"Actors: ", MV_CONCAT(actors, ", "), "\n",
119135
)
120-
| COMPLETION summary = prompt WITH test_completion_model
136+
| COMPLETION summary = prompt WITH { "inference_id" : "my_inference_endpoint" }
121137
| KEEP title, summary, rating
122138
```
123139

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

Lines changed: 51 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,19 @@ POST my-image-index/_search
203203
`knn` query can be used inside a nested query. The behaviour here is similar to [top level nested kNN search](docs-content://solutions/search/vector/knn.md#nested-knn-search):
204204

205205
* kNN search over nested dense_vectors diversifies the top results over the top-level document
206-
* `filter` over the top-level document metadata is supported and acts as a pre-filter
207-
* `filter` over `nested` field metadata is not supported
206+
* `filter` both over the top-level document metadata and `nested` is supported and acts as a pre-filter
207+
208+
::::{note}
209+
To ensure correct results: each individual filter must be either over
210+
the top-level metadata or `nested` metadata. However, a single knn query
211+
supports multiple filters, where some filters can be over the top-level
212+
metadata and some over nested.
213+
::::
208214

209-
A sample query can look like below:
215+
216+
Below is a sample query with filter over nested metadata.
217+
For scoring parents' documents, this query only considers vectors that
218+
have "paragraph.language" set to "EN".
210219

211220
```json
212221
{
@@ -215,12 +224,46 @@ A sample query can look like below:
215224
"path" : "paragraph",
216225
"query" : {
217226
"knn": {
218-
"query_vector": [
219-
0.45,
220-
45
221-
],
227+
"query_vector": [0.45, 0.50],
222228
"field": "paragraph.vector",
223-
"num_candidates": 2
229+
"filter": {
230+
"match": {
231+
"paragraph.language": "EN"
232+
}
233+
}
234+
}
235+
}
236+
}
237+
}
238+
}
239+
```
240+
241+
Below is a sample query with two filters: one over nested metadata
242+
and another over the top level metadata. For scoring parents' documents,
243+
this query only considers vectors whose parent's title contain "essay"
244+
word and have "paragraph.language" set to "EN".
245+
246+
```json
247+
{
248+
"query" : {
249+
"nested" : {
250+
"path" : "paragraph",
251+
"query" : {
252+
"knn": {
253+
"query_vector": [0.45, 0.50],
254+
"field": "paragraph.vector",
255+
"filter": [
256+
{
257+
"match": {
258+
"paragraph.language": "EN"
259+
}
260+
},
261+
{
262+
"match": {
263+
"title": "essay"
264+
}
265+
}
266+
]
224267
}
225268
}
226269
}

0 commit comments

Comments
 (0)