Skip to content

Commit 4227e24

Browse files
committed
Merge branch 'main' into lucene_snapshot
2 parents 41cfb9f + edd4ebf commit 4227e24

File tree

91 files changed

+2636
-959
lines changed

Some content is hidden

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

91 files changed

+2636
-959
lines changed

docs/changelog/115797.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 115797
2+
summary: Enable `_tier` based coordinator rewrites for all indices (not just mounted
3+
indices)
4+
area: Search
5+
type: enhancement
6+
issues: []

docs/changelog/115994.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 115994
2+
summary: Add logsdb telemetry
3+
area: Logs
4+
type: enhancement
5+
issues: []

docs/changelog/116060.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 116060
2+
summary: Fix leak in `DfsQueryPhase` and introduce search disconnect stress test
3+
area: Search
4+
type: bug
5+
issues:
6+
- 115056

docs/changelog/116086.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 116086
2+
summary: "ESQL: Fix DEBUG log of filter"
3+
area: ES|QL
4+
type: bug
5+
issues:
6+
- 116055

docs/reference/cat/shards.asciidoc

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
====
1010
cat APIs are only intended for human consumption using the command line or {kib}
1111
console.
12-
They are _not_ intended for use by applications. For application
12+
They are _not_ intended for use by applications. For application
1313
consumption, use the <<cluster-state,cluster state API>>.
1414
====
1515

1616
The `shards` command is the detailed view of all nodes' shard <<shard-allocation-relocation-recovery,allocation>>.
17-
It will tell you if the shard is a primary or replica, the number of docs, the
18-
bytes it takes on disk, the node where it's located, and if the shard is
17+
It will tell you if the shard is a primary or replica, the number of docs, the
18+
bytes it takes on disk, the node where it's located, and if the shard is
1919
currently <<shard-allocation-relocation-recovery,recovering>>.
2020

2121
For <<data-streams,data streams>>, the API returns information about the stream's backing indices.
@@ -258,9 +258,6 @@ Time spent in suggest, such as `0`.
258258
`suggest.total`, `suto`, `suggestTotal`::
259259
Number of suggest operations, such as `0`.
260260

261-
`sync_id`::
262-
Sync ID of the shard.
263-
264261
`unassigned.at`, `ua`::
265262
Time at which the shard became unassigned in
266263
{wikipedia}/List_of_UTC_time_offsets[Coordinated Universal Time (UTC)].

docs/reference/esql/esql-functions-operators.asciidoc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ include::functions/ip-functions.asciidoc[tag=ip_list]
4848
include::functions/math-functions.asciidoc[tag=math_list]
4949
====
5050

51+
.*Search functions*
52+
[%collapsible]
53+
====
54+
include::functions/search-functions.asciidoc[tag=search_list]
55+
====
56+
5157
.*Spatial functions*
5258
[%collapsible]
5359
====
@@ -89,6 +95,7 @@ include::functions/conditional-functions-and-expressions.asciidoc[]
8995
include::functions/date-time-functions.asciidoc[]
9096
include::functions/ip-functions.asciidoc[]
9197
include::functions/math-functions.asciidoc[]
98+
include::functions/search-functions.asciidoc[]
9299
include::functions/spatial-functions.asciidoc[]
93100
include::functions/string-functions.asciidoc[]
94101
include::functions/type-conversion-functions.asciidoc[]

docs/reference/esql/esql-limitations.asciidoc

Lines changed: 81 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -102,33 +102,46 @@ is currently experimental.
102102

103103
[discrete]
104104
[[esql-limitations-full-text-search]]
105-
=== Full-text search is not supported
105+
=== Full-text search
106106

107-
Because of <<esql-limitations-text-fields,the way {esql} treats `text` values>>,
108-
full-text search is not yet supported. Queries on `text` fields are like queries
109-
on `keyword` fields: they are case-sensitive and need to match the full string.
107+
experimental:[] {esql}'s support for <<esql-search-functions,full-text search>>
108+
is currently in Technical Preview. One limitation of full-text search is that
109+
it is necessary to use the search function, like <<esql-match>>, in a <<esql-where>> command
110+
directly after the <<esql-from>> source command, or close enough to it.
111+
Otherwise, the query will fail with a validation error.
112+
Another limitation is that any <<esql-where>> command containing a full-text search function
113+
cannot also use disjunctions (`OR`).
114+
115+
For example, this query is valid:
110116

111-
For example, after indexing a field of type `text` with the value `Elasticsearch
112-
query language`, the following `WHERE` clause does not match because the `LIKE`
113-
operator is case-sensitive:
114117
[source,esql]
115118
----
116-
| WHERE field LIKE "elasticsearch query language"
119+
FROM books
120+
| WHERE MATCH(author, "Faulkner") AND MATCH(author, "Tolkien")
117121
----
118122

119-
The following `WHERE` clause does not match either, because the `LIKE` operator
120-
tries to match the whole string:
123+
But this query will fail due to the <<esql-stats-by, STATS>> command:
124+
121125
[source,esql]
122126
----
123-
| WHERE field LIKE "Elasticsearch"
127+
FROM books
128+
| STATS AVG(price) BY author
129+
| WHERE MATCH(author, "Faulkner")
124130
----
125131

126-
As a workaround, use wildcards and regular expressions. For example:
132+
And this query will fail due to the disjunction:
133+
127134
[source,esql]
128135
----
129-
| WHERE field RLIKE "[Ee]lasticsearch.*"
136+
FROM books
137+
| WHERE MATCH(author, "Faulkner") OR author LIKE "Hemingway"
130138
----
131139

140+
Note that, because of <<esql-limitations-text-fields,the way {esql} treats `text` values>>,
141+
any queries on `text` fields that do not explicitly use the full-text functions,
142+
<<esql-match>> or <<esql-qstr>>, will behave as if the fields are actually `keyword` fields:
143+
they are case-sensitive and need to match the full string.
144+
132145
[discrete]
133146
[[esql-limitations-text-fields]]
134147
=== `text` fields behave like `keyword` fields
@@ -141,15 +154,68 @@ that. If it's not possible to retrieve a `keyword` subfield, {esql} will get the
141154
string from a document's `_source`. If the `_source` cannot be retrieved, for
142155
example when using synthetic source, `null` is returned.
143156

157+
Once a `text` field is retrieved, if the query touches it in any way, for example passing
158+
it into a function, the type will be converted to `keyword`. In fact, functions that operate on both
159+
`text` and `keyword` fields will perform as if the `text` field was a `keyword` field all along.
160+
161+
For example, the following query will return a column `greatest` of type `keyword` no matter
162+
whether any or all of `field1`, `field2`, and `field3` are of type `text`:
163+
[source,esql]
164+
----
165+
| FROM index
166+
| EVAL greatest = GREATEST(field1, field2, field3)
167+
----
168+
144169
Note that {esql}'s retrieval of `keyword` subfields may have unexpected
145-
consequences. An {esql} query on a `text` field is case-sensitive. Furthermore,
146-
a subfield may have been mapped with a <<normalizer,normalizer>>, which can
170+
consequences. Other than when explicitly using the full-text functions, <<esql-match>> and <<esql-qstr>>,
171+
any {esql} query on a `text` field is case-sensitive.
172+
173+
For example, after indexing a field of type `text` with the value `Elasticsearch
174+
query language`, the following `WHERE` clause does not match because the `LIKE`
175+
operator is case-sensitive:
176+
[source,esql]
177+
----
178+
| WHERE field LIKE "elasticsearch query language"
179+
----
180+
181+
The following `WHERE` clause does not match either, because the `LIKE` operator
182+
tries to match the whole string:
183+
[source,esql]
184+
----
185+
| WHERE field LIKE "Elasticsearch"
186+
----
187+
188+
As a workaround, use wildcards and regular expressions. For example:
189+
[source,esql]
190+
----
191+
| WHERE field RLIKE "[Ee]lasticsearch.*"
192+
----
193+
194+
Furthermore, a subfield may have been mapped with a <<normalizer,normalizer>>, which can
147195
transform the original string. Or it may have been mapped with <<ignore-above>>,
148196
which can truncate the string. None of these mapping operations are applied to
149197
an {esql} query, which may lead to false positives or negatives.
150198

151199
To avoid these issues, a best practice is to be explicit about the field that
152200
you query, and query `keyword` sub-fields instead of `text` fields.
201+
Or consider using one of the <<esql-search-functions,full-text search>> functions.
202+
203+
[discrete]
204+
[[esql-multi-index-limitations]]
205+
=== Using {esql} to query multiple indices
206+
207+
As discussed in more detail in <<esql-multi-index>>, {esql} can execute a single query across multiple indices,
208+
data streams, or aliases. However, there are some limitations to be aware of:
209+
210+
* All underlying indexes and shards must be active. Using admin commands or UI,
211+
it is possible to pause an index or shard, for example by disabling a frozen tier instance,
212+
but then any {esql} query that includes that index or shard will fail, even if the query uses
213+
<<esql-where>> to filter out the results from the paused index.
214+
If you see an error of type `search_phase_execution_exception`,
215+
with the message `Search rejected due to missing shards`, you likely have an index or shard in `UNASSIGNED` state.
216+
* The same field must have the same type across all indexes. If the same field is mapped to different types
217+
it is still possible to query the indexes,
218+
but the field must be <<esql-multi-index-union-types,explicitly converted to a single type>>.
153219

154220
[discrete]
155221
[[esql-tsdb]]
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[[esql-search-functions]]
2+
==== {esql} Full-text search functions
3+
4+
++++
5+
<titleabbrev>Full-text Search functions</titleabbrev>
6+
++++
7+
8+
{esql} supports these full-text search functions:
9+
10+
// tag::search_list[]
11+
* experimental:[] <<esql-match>>
12+
* experimental:[] <<esql-qstr>>
13+
// end::search_list[]
14+
15+
include::layout/match.asciidoc[]
16+
include::layout/qstr.asciidoc[]

docs/reference/rest-api/info.asciidoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@ Example response:
172172
"universal_profiling": {
173173
"available": true,
174174
"enabled": true
175+
},
176+
"logsdb": {
177+
"available": true,
178+
"enabled": false
175179
}
176180
},
177181
"tagline" : "You know, for X"

docs/reference/rest-api/usage.asciidoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,12 @@ GET /_xpack/usage
518518
"universal_profiling" : {
519519
"available" : true,
520520
"enabled" : true
521+
},
522+
"logsdb": {
523+
"available": true,
524+
"enabled": false,
525+
"indices_count": 0,
526+
"indices_with_synthetic_source": 0
521527
}
522528
}
523529
------------------------------------------------------------

0 commit comments

Comments
 (0)