Skip to content

Commit 8a90d88

Browse files
committed
Merge remote-tracking branch 'upstream/main' into flash1293/grok-multiple-patterns
2 parents f0d7429 + 8172161 commit 8a90d88

File tree

173 files changed

+4352
-856
lines changed

Some content is hidden

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

173 files changed

+4352
-856
lines changed

benchmarks/src/main/java/org/elasticsearch/benchmark/_nightly/esql/QueryPlanningBenchmark.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public void setup() {
7676
Locale.US,
7777
null,
7878
null,
79-
new QueryPragmas(Settings.EMPTY),
79+
QueryPragmas.EMPTY,
8080
AnalyzerSettings.QUERY_RESULT_TRUNCATION_MAX_SIZE.getDefault(Settings.EMPTY),
8181
AnalyzerSettings.QUERY_RESULT_TRUNCATION_DEFAULT_SIZE.getDefault(Settings.EMPTY),
8282
"",

benchmarks/src/main/java/org/elasticsearch/benchmark/compute/operator/EvalBenchmark.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
import org.elasticsearch.xpack.esql.expression.predicate.operator.comparison.Equals;
5757
import org.elasticsearch.xpack.esql.expression.predicate.operator.comparison.LessThan;
5858
import org.elasticsearch.xpack.esql.planner.Layout;
59+
import org.elasticsearch.xpack.esql.plugin.QueryPragmas;
5960
import org.elasticsearch.xpack.esql.session.Configuration;
6061
import org.openjdk.jmh.annotations.Benchmark;
6162
import org.openjdk.jmh.annotations.BenchmarkMode;
@@ -358,7 +359,7 @@ private static Configuration configuration() {
358359
Locale.ROOT,
359360
null,
360361
null,
361-
null,
362+
QueryPragmas.EMPTY,
362363
AnalyzerSettings.QUERY_RESULT_TRUNCATION_MAX_SIZE.get(Settings.EMPTY),
363364
AnalyzerSettings.QUERY_RESULT_TRUNCATION_DEFAULT_SIZE.get(Settings.EMPTY),
364365
null,

benchmarks/src/main/java/org/elasticsearch/benchmark/exponentialhistogram/ExponentialHistogramMergeBench.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
import org.elasticsearch.exponentialhistogram.ExponentialHistogramCircuitBreaker;
1717
import org.elasticsearch.exponentialhistogram.ExponentialHistogramGenerator;
1818
import org.elasticsearch.exponentialhistogram.ExponentialHistogramMerger;
19+
import org.elasticsearch.xpack.analytics.mapper.IndexWithCount;
1920
import org.elasticsearch.xpack.exponentialhistogram.CompressedExponentialHistogram;
20-
import org.elasticsearch.xpack.exponentialhistogram.IndexWithCount;
2121
import org.openjdk.jmh.annotations.Benchmark;
2222
import org.openjdk.jmh.annotations.BenchmarkMode;
2323
import org.openjdk.jmh.annotations.Fork;

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/InternalDistributionModuleCheckTaskProvider.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ public class InternalDistributionModuleCheckTaskProvider {
5353
"org.elasticsearch.base",
5454
"org.elasticsearch.cli",
5555
"org.elasticsearch.entitlement",
56+
"org.elasticsearch.exponentialhistogram",
5657
"org.elasticsearch.geo",
5758
"org.elasticsearch.grok",
5859
"org.elasticsearch.logging",

docs/changelog/135961.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 135961
2+
summary: Late materialization of dimension fields in time-series
3+
area: TSDB
4+
type: enhancement
5+
issues: []

docs/changelog/136039.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
pr: 136039
2+
summary: Disable cross-cluster functionality for `_fleet/_fleet_search`
3+
area: Search
4+
type: breaking
5+
issues: []
6+
breaking:
7+
title: Disable cross-cluster functionality for `_fleet/_fleet_search`
8+
area: Search
9+
details: |-
10+
This endpoint is largely used for local searches only and is not compatible with true cross-cluster searches where
11+
arbitrary number of indices and remotes can be specified. Although it is meant to accept an index parameter that
12+
denotes a single searchable target, such a limitation can be bypassed through various means.
13+
14+
Keeping in view this endpoint's stated intent and future scope, cross-cluster functionality is being explicitly disabled.
15+
impact: |-
16+
This endpoint will no longer accept remote indices. Should one be provided, a top-level error is returned with
17+
an appropriate explanation.
18+
notable: false

docs/changelog/136684.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 136684
2+
summary: Lazy compute and cache `grantsAll` per privilege
3+
area: Authorization
4+
type: enhancement
5+
issues: []

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,18 @@ applies_to:
1313
We don't recommend this legacy query type for _new_ projects. Use the match query (with [QueryDSL](/reference/query-languages/query-dsl/query-dsl-match-query.md) or [ESQL](/reference/query-languages/esql/functions-operators/search-functions.md#esql-match)) instead. The semantic query remains available to support existing implementations.
1414
::::
1515

16-
The `semantic` query type enables you to perform [semantic search](docs-content://solutions/search/semantic-search.md) on data stored in a [`semantic_text`](/reference/elasticsearch/mapping-reference/semantic-text.md) field.
16+
The `semantic` query type enables you to perform [semantic search](docs-content://solutions/search/semantic-search.md) on data stored in a [`semantic_text`](/reference/elasticsearch/mapping-reference/semantic-text.md) field. This query accepts natural-language text and uses the field’s configured inference endpoint to generate a query embedding and match documents.
1717

18+
For an overview of all query options available for `semantic_text` fields, see [Querying `semantic_text` fields](/reference/elasticsearch/mapping-reference/semantic-text.md#querying-semantic-text-fields).
19+
20+
## Inference endpoint selection
21+
22+
The target field of `semantic` query must be mapped as `semantic_text` and associated with an inference endpoint. At query time, the inference endpoint is chosen as follows:
23+
- If `search_inference_id` is defined, the semantic query uses that endpoint to embed the query.
24+
- If no `search_inference_id` is defined, `inference_id` is used for both indexing and search.
25+
- If no endpoint is specified at mapping, `inference_id` defaults to `.elser-2-elasticsearch`.
26+
27+
The underlying vector type (dense or sparse) is determined by the endpoint automatically. No extra query parameters are required.
1828

1929
## Example request [semantic-query-example]
2030

docs/reference/query-languages/query-dsl/query-dsl-sparse-vector-query.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,54 @@ GET my-index/_search
208208
```
209209
% TEST[skip: Requires inference]
210210

211+
## Example query on a `semantic_text` field
212+
213+
You can also run a `sparse_vector` query directly on a [`semantic_text`](/reference/elasticsearch/mapping-reference/semantic-text.md) field. In this case Elasticsearch automatically uses the inference endpoint configured in the field mapping to expand the query into sparse tokens.
214+
215+
First, create an index with a `semantic_text` field:
216+
217+
```console
218+
PUT /my-semantic-sparse-index
219+
{
220+
"mappings": {
221+
"properties": {
222+
"title": { "type": "text" },
223+
"content_semantic": {
224+
"type": "semantic_text",
225+
"inference_id": ".elser-2-elasticsearch"
226+
}
227+
}
228+
}
229+
}
230+
```
231+
232+
Index some example documents:
233+
234+
```console
235+
POST /my-semantic-sparse-index/_bulk
236+
{ "index": { "_index": "my-semantic-sparse-index", "_id": "1" } }
237+
{ "title": "Best surfing spots", "content_semantic": "Hawaii has world-class surfing with warm water and consistent swells." }
238+
{ "index": { "_index": "my-semantic-sparse-index", "_id": "2" } }
239+
{ "title": "City breaks", "content_semantic": "Paris offers museums, cafés, and beautiful architecture." }
240+
{ "index": { "_index": "my-semantic-sparse-index", "_id": "3" } }
241+
{ "title": "Learning to surf", "content_semantic": "Beginners often start on longboards at gentle beach breaks." }
242+
```
243+
244+
Then query with `sparse_vector` against the `semantic_text` field:
245+
246+
```console
247+
GET my-semantic-sparse-index/_search
248+
{
249+
"size": 3,
250+
"query": {
251+
"sparse_vector": {
252+
"field": "content_semantic",
253+
"query": "best places to surf as a beginner"
254+
}
255+
}
256+
}
257+
```
258+
211259

212260
## Example ELSER query with pruning configuration and rescore [sparse-vector-query-with-pruning-config-and-rescore-example]
213261

libs/exponential-histogram/build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ dependencies {
1717
api project(':libs:x-content')
1818
api "org.apache.lucene:lucene-core:${versions.lucene}"
1919

20-
testImplementation(project(":test:framework"))
20+
testImplementation(project(":test:framework")) {
21+
exclude group: 'org.elasticsearch', module: 'exponential-histogram'
22+
}
2123
testImplementation('ch.obermuhlner:big-math:2.3.2')
2224
testImplementation('org.apache.commons:commons-math3:3.6.1')
2325
testImplementation project(':libs:x-content:impl')

0 commit comments

Comments
 (0)