Skip to content

Commit 6b70da6

Browse files
authored
Merge branch 'main' into leemthompo/esql-search
2 parents 4f4289f + 7ddd0fb commit 6b70da6

File tree

8 files changed

+77
-18
lines changed

8 files changed

+77
-18
lines changed

deploy-manage/toc.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -784,11 +784,9 @@ toc:
784784
- file: upgrade/deployment-or-cluster/reading-indices-from-older-elasticsearch-versions.md
785785
- file: upgrade/deployment-or-cluster/kibana.md
786786
children:
787+
- file: upgrade/deployment-or-cluster/saved-object-migrations.md
787788
- file: upgrade/deployment-or-cluster/kibana-roll-back.md
788-
- file: upgrade/ingest-components.md
789-
- file: upgrade/internal-upgrade-processes.md
790-
children:
791-
- file: upgrade/internal-upgrade-processes/saved-object-migrations.md
789+
- file: upgrade/ingest-components.md
792790
- file: uninstall.md
793791
children:
794792
- file: uninstall/uninstall-elastic-cloud-enterprise.md

deploy-manage/upgrade/deployment-or-cluster/kibana.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ When you upgrade {{kib}}, you also upgrade the {{observability}} and {{elastic-s
1111
::::{warning}
1212
{{kib}} automatically runs saved object migrations when required. To roll back to an earlier version in case of an upgrade failure, you **must** have a [backup snapshot](../../tools/snapshot-and-restore.md) that includes the `kibana` feature state. Snapshots include this feature state by default.
1313

14-
For more information, refer to [Migrate saved objects](../internal-upgrade-processes/saved-object-migrations.md).
14+
For more information, refer to [Migrate saved objects](saved-object-migrations.md).
1515

1616
::::
1717

File renamed without changes.

deploy-manage/upgrade/internal-upgrade-processes.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

explore-analyze/find-and-organize/saved-objects.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ We have made several enhancements to minimize the impact, and this document desc
127127

128128
### Impact upon upgrading to version 8.x or later [saved-object-ids-impact-upon-upgrading]
129129

130-
Every time you upgrade {{kib}}, [saved objects are migrated to a new format](/deploy-manage/upgrade/internal-upgrade-processes/saved-object-migrations.md). When you first upgrade to version 8.x or later, this migration process will start enforcing globally unique saved object IDs.
130+
Every time you upgrade {{kib}}, [saved objects are migrated to a new format](/deploy-manage/upgrade/deployment-or-cluster/saved-object-migrations.md). When you first upgrade to version 8.x or later, this migration process will start enforcing globally unique saved object IDs.
131131

132132
In practical terms, **any old saved objects that exist in a custom space will have their IDs changed to a new UUID**, while saved objects in the Default space will be unchanged. This is how we can ensure that every saved object ID is unique. For example: if you had dashboard "123" in the Default space and dashboard "123" in Another space, after the upgrade you would have dashboard "123" in the Default space and dashboard "456" in Another space.
133133

explore-analyze/query-filter/languages/querydsl.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ mapped_urls:
77
- https://www.elastic.co/guide/en/elasticsearch/reference/current/query-filter-context.html
88
---
99

10-
# QueryDSL
10+
# Query DSL
1111

1212
$$$filter-context$$$
1313

solutions/search/hybrid-semantic-text.md

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,15 @@ POST _tasks/<task_id>/_cancel
102102

103103
## Perform hybrid search [hybrid-search-perform-search]
104104

105-
After reindexing the data into the `semantic-embeddings` index, you can perform hybrid search by using [reciprocal rank fusion (RRF)](elasticsearch://reference/elasticsearch/rest-apis/reciprocal-rank-fusion.md). RRF is a technique that merges the rankings from both semantic and lexical queries, giving more weight to results that rank high in either search. This ensures that the final results are balanced and relevant.
105+
After reindexing the data into the `semantic-embeddings` index, you can perform hybrid search to combine semantic and lexical search results. Choose between [retrievers](retrievers-overview.md) or [{{esql}}](/explore-analyze/query-filter/languages/esql.md) syntax to execute the query.
106+
107+
::::{tab-set}
108+
:group: query-type
109+
110+
:::{tab-item} Query DSL
111+
:sync: retrievers
112+
113+
This example uses [retrievers syntax](retrievers-overview.md) with [reciprocal rank fusion (RRF)](elasticsearch://reference/elasticsearch/rest-apis/reciprocal-rank-fusion.md). RRF is a technique that merges the rankings from both semantic and lexical queries, giving more weight to results that rank high in either search. This ensures that the final results are balanced and relevant.
106114

107115
```console
108116
GET semantic-embeddings/_search
@@ -141,7 +149,7 @@ GET semantic-embeddings/_search
141149
4. The `semantic_text` field is used to perform the semantic search.
142150

143151

144-
After performing the hybrid search, the query will return the top 10 documents that match both semantic and lexical search criteria. The results include detailed information about each document:
152+
After performing the hybrid search, the query will return the combined top 10 documents for both semantic and lexical search criteria. The results include detailed information about each document.
145153

146154
```console-result
147155
{
@@ -202,3 +210,30 @@ After performing the hybrid search, the query will return the top 10 documents t
202210
}
203211
}
204212
```
213+
:::
214+
215+
:::{tab-item} ES|QL
216+
:sync: esql
217+
218+
The ES|QL approach uses a combination of the match operator `:` and the match function `match()` to perform hybrid search.
219+
220+
```console
221+
POST /_query?format=txt
222+
{
223+
"query": """
224+
FROM semantic-embeddings METADATA _score <1>
225+
| WHERE content: "muscle soreness running?" OR match(semantic_text, "How to avoid muscle soreness while running?", { "boost": 0.75 }) <2> <3>
226+
| SORT _score DESC <4>
227+
| LIMIT 1000
228+
"""
229+
}
230+
```
231+
1. The `METADATA _score` clause is used to return the score of each document
232+
2. The [match (`:`) operator](elasticsearch://reference/query-languages/esql/esql-functions-operators.md#esql-search-operators) is used on the `content` field for standard keyword matching
233+
3. Semantic search using the `match()` function on the `semantic_text` field with a boost of `0.75`
234+
4. Sorts by descending score and limits to 1000 results
235+
:::
236+
::::
237+
238+
239+

solutions/search/semantic-search/semantic-search-semantic-text.md

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,25 +101,56 @@ POST _tasks/<task_id>/_cancel
101101

102102
## Semantic search [semantic-text-semantic-search]
103103

104-
After the data set has been enriched with the embeddings, you can query the data using semantic search. Provide the `semantic_text` field name and the query text in a `semantic` query type. The {{infer}} endpoint used to generate the embeddings for the `semantic_text` field will be used to process the query text.
104+
After the data has been indexed with the embeddings, you can query the data using semantic search. Choose between [Query DSL](/explore-analyze/query-filter/languages/querydsl.md) or [{{esql}}](/explore-analyze/query-filter/languages/esql.md) syntax to execute the query.
105105

106-
```console
106+
::::{tab-set}
107+
:group: query-type
108+
109+
:::{tab-item} Query DSL
110+
:sync: dsl
111+
112+
The Query DSL approach uses the `semantic` query type with the `semantic_text` field:
113+
114+
```esql
107115
GET semantic-embeddings/_search
108116
{
109117
"query": {
110118
"semantic": {
111119
"field": "content", <1>
112-
"query": "How to avoid muscle soreness while running?" <2>
120+
"query": "What causes muscle soreness after running?" <2>
113121
}
114122
}
115123
}
116124
```
117125

118126
1. The `semantic_text` field on which you want to perform the search.
119127
2. The query text.
128+
:::
129+
130+
:::{tab-item} ES|QL
131+
:sync: esql
132+
133+
The ES|QL approach uses the [match (`:`) operator](elasticsearch://reference/query-languages/esql/esql-functions-operators.md#esql-search-operators), which automatically detects the `semantic_text` field and performs the search on it. The query uses `METADATA _score` to sort by `_score` in descending order.
120134

121135

122-
As a result, you receive the top 10 documents that are closest in meaning to the query from the `semantic-embedding` index.
136+
```console
137+
POST /_query?format=txt
138+
{
139+
"query": """
140+
FROM semantic-embeddings METADATA _score <1>
141+
| WHERE content: "How to avoid muscle soreness while running?" <2>
142+
| SORT _score DESC <3>
143+
| LIMIT 1000 <4>
144+
"""
145+
}
146+
```
147+
1. The `METADATA _score` clause is used to return the score of each document
148+
2. The [match (`:`) operator](elasticsearch://reference/query-languages/esql/esql-functions-operators.md#esql-search-operators) is used on the `content` field for standard keyword matching
149+
3. Sorts by descending score to display the most relevant results first
150+
4. Limits the results to 1000 documents
151+
152+
:::
153+
::::
123154

124155

125156
## Further examples and reading [semantic-text-further-examples]

0 commit comments

Comments
 (0)