Skip to content

Commit 630a26e

Browse files
authored
Adds ELSER on EIS examples to semantic_text (#135359)
* Adds ELSER on EIS examples to semantic_text. * Adds applies_to tags. * Amends applies_to tags. * moreedits. * Modifies subs. * Modifies more subs. * Update docs/reference/elasticsearch/mapping-reference/semantic-text.md * Update docs/reference/elasticsearch/mapping-reference/semantic-text.md * Update docs/reference/elasticsearch/mapping-reference/semantic-text.md * Update docs/reference/elasticsearch/mapping-reference/semantic-text.md
1 parent 5e471b4 commit 630a26e

File tree

1 file changed

+102
-13
lines changed

1 file changed

+102
-13
lines changed

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

Lines changed: 102 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,12 @@ type make it simpler to perform semantic search on your data. The
2525
with [match](/reference/query-languages/query-dsl/query-dsl-match-query.md), [sparse_vector](/reference/query-languages/query-dsl/query-dsl-sparse-vector-query.md)
2626
or [knn](/reference/query-languages/query-dsl/query-dsl-knn-query.md) queries.
2727

28-
If you don’t specify an inference endpoint, the `inference_id` field defaults to
29-
`.elser-2-elasticsearch`, a preconfigured endpoint for the elasticsearch
30-
service.
28+
{applies_to}`serverless: ga` If you don’t specify an {{infer}} endpoint, the `inference_id` field defaults to
29+
`.elser-v2-elastic`, a preconfigured endpoint for the `elasticsearch` service.
30+
This endpoint uses the [Elastic {{infer-cap}} Service (EIS)](docs-content://explore-analyze/elastic-inference/eis.md#elser-on-eis).
31+
32+
{applies_to}`stack: ga 9.0` If you don’t specify an {{infer}} endpoint, the `inference_id` field defaults to
33+
`.elser-2-elasticsearch`, a preconfigured endpoint for the `elasticsearch` service.
3134

3235
Using `semantic_text`, you won’t need to specify how to generate embeddings for
3336
your data, or how to index it. The {{infer}} endpoint automatically determines
@@ -43,10 +46,15 @@ You can use either preconfigured endpoints in your `semantic_text` fields which
4346
are ideal for most use cases or create custom endpoints and reference them in
4447
the field mappings.
4548

46-
### Using the default ELSER endpoint
49+
:::::::{tab-set}
50+
51+
::::::{tab-item} Using the default ELSER on EIS endpoint on Serverless
52+
53+
```{applies_to}
54+
serverless: ga
55+
```
4756

48-
If you use the preconfigured `.elser-2-elasticsearch` endpoint, you can set up
49-
`semantic_text` with the following API request:
57+
If you use the default `.elser-v2-elastic` endpoint that runs on EIS, you can set up `semantic_text` with the following API request:
5058

5159
```console
5260
PUT my-index-000001
@@ -62,10 +70,58 @@ PUT my-index-000001
6270
```
6371
% TEST[skip:Requires inference endpoint]
6472

73+
::::::
74+
75+
::::::{tab-item} Using the preconfigured ELSER on EIS endpoint in Cloud
76+
77+
```{applies_to}
78+
stack: ga 9.2
79+
deployment:
80+
self: unavailable
81+
```
82+
83+
If you use the preconfigured `.elser-v2-elastic` endpoint that runs on EIS, you can set up `semantic_text` with the following API request:
84+
85+
```console
86+
PUT my-index-000001
87+
{
88+
"mappings": {
89+
"properties": {
90+
"inference_field": {
91+
"type": "semantic_text",
92+
"inference_id": ".elser-v2-elastic"
93+
}
94+
}
95+
}
96+
}
97+
```
98+
99+
::::::
100+
101+
::::::{tab-item} Using the default ELSER endpoint
102+
103+
If you use the preconfigured `.elser-2-elasticsearch` endpoint, you can set up `semantic_text` with the following API request:
104+
105+
```console
106+
PUT my-index-000001
107+
{
108+
"mappings": {
109+
"properties": {
110+
"inference_field": {
111+
"type": "semantic_text"
112+
}
113+
}
114+
}
115+
}
116+
```
117+
118+
::::::
119+
120+
:::::::
121+
65122
### Using a custom endpoint
66123

67-
To use a custom {{infer}} endpoint instead of the default
68-
`.elser-2-elasticsearch`, you
124+
To use a custom {{infer}} endpoint instead of the default, you
69125
must [Create {{infer}} API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put)
70126
and specify its `inference_id` when setting up the `semantic_text` field type.
71127

@@ -110,14 +166,48 @@ PUT my-index-000003
110166
% TEST[skip:Requires inference endpoint]
111167

112168
### Using ELSER on EIS
169+
113170
```{applies_to}
114-
stack: preview 9.1
115-
serverless: preview
171+
stack: preview 9.1 ga 9.2
172+
deployment:
173+
self: unavailable
174+
serverless: ga
116175
```
117176

118177
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
119178
set up `semantic_text` with the following API request:
120179

180+
:::::::{tab-set}
181+
182+
::::::{tab-item} Using ELSER on EIS on Serverless
183+
184+
```{applies_to}
185+
serverless: ga
186+
```
187+
188+
```console
189+
PUT my-index-000001
190+
{
191+
"mappings": {
192+
"properties": {
193+
"inference_field": {
194+
"type": "semantic_text"
195+
}
196+
}
197+
}
198+
}
199+
```
200+
201+
::::::
202+
203+
::::::{tab-item} Using ELSER on EIS in Cloud
204+
205+
```{applies_to}
206+
stack: ga 9.2
207+
deployment:
208+
self: unavailable
209+
```
210+
121211
```console
122212
PUT my-index-000001
123213
{
@@ -133,10 +223,9 @@ PUT my-index-000001
133223
```
134224
% TEST[skip:Requires inference endpoint]
135225

136-
::::{note}
137-
While we do encourage experimentation, we do not recommend implementing production use cases on top of this feature while it is in Technical Preview.
226+
::::::
138227

139-
::::
228+
:::::::
140229

141230
## Parameters for `semantic_text` fields [semantic-text-params]
142231

0 commit comments

Comments
 (0)