Skip to content

Commit 5e01999

Browse files
authored
[DOCS] Improves semantic text documentation. (#113606)
1 parent 1faa351 commit 5e01999

File tree

2 files changed

+37
-9
lines changed

2 files changed

+37
-9
lines changed

docs/reference/inference/delete-inference.asciidoc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,12 @@ The type of {infer} task that the model performs.
4949

5050
`dry_run`::
5151
(Optional, Boolean)
52-
When `true`, checks the {infer} processors that reference the endpoint and
53-
returns them in a list, but does not delete the endpoint. Defaults to `false`.
52+
When `true`, checks the `semantic_text` fields and {infer} processors that reference the endpoint and returns them in a list, but does not delete the endpoint.
53+
Defaults to `false`.
5454

5555
`force`::
5656
(Optional, Boolean)
57-
Deletes the endpoint regardless if it's used in an {infer} pipeline or in a
58-
`semantic_text` field.
57+
Deletes the endpoint regardless if it's used in a `semantic_text` field or in an {infer} pipeline.
5958

6059

6160
[discrete]

docs/reference/mapping/types/semantic-text.asciidoc

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@ The `semantic_text` field type specifies an inference endpoint identifier that w
1414
You can create the inference endpoint by using the <<put-inference-api>>.
1515
This field type and the <<query-dsl-semantic-query,`semantic` query>> type make it simpler to perform semantic search on your data.
1616

17-
Using `semantic_text`, you won't need to specify how to generate embeddings for
18-
your data, or how to index it. The inference endpoint automatically determines
19-
the embedding generation, indexing, and query to use.
17+
Using `semantic_text`, you won't need to specify how to generate embeddings for your data, or how to index it.
18+
The {infer} endpoint automatically determines the embedding generation, indexing, and query to use.
2019

2120
[source,console]
2221
------------------------------------------------------------
@@ -32,7 +31,29 @@ PUT my-index-000001
3231
}
3332
}
3433
------------------------------------------------------------
35-
// TEST[skip:TBD]
34+
// TEST[skip:Requires inference endpoint]
35+
36+
37+
The recommended way to use semantic_text is by having dedicated {infer} endpoints for ingestion and search.
38+
This ensures that search speed remains unaffected by ingestion workloads, and vice versa.
39+
After creating dedicated {infer} endpoints for both, you can reference them using the `inference_id` and `search_inference_id` parameters when setting up the index mapping for an index that uses the `semantic_text` field.
40+
41+
[source,console]
42+
------------------------------------------------------------
43+
PUT my-index-000002
44+
{
45+
"mappings": {
46+
"properties": {
47+
"inference_field": {
48+
"type": "semantic_text",
49+
"inference_id": "my-elser-endpoint-for-ingest",
50+
"search_inference_id": "my-elser-endpoint-for-search"
51+
}
52+
}
53+
}
54+
}
55+
------------------------------------------------------------
56+
// TEST[skip:Requires inference endpoint]
3657

3758

3859
[discrete]
@@ -41,9 +62,15 @@ PUT my-index-000001
4162

4263
`inference_id`::
4364
(Required, string)
44-
Inference endpoint that will be used to generate the embeddings for the field.
65+
{infer-cap} endpoint that will be used to generate the embeddings for the field.
4566
Use the <<put-inference-api>> to create the endpoint.
67+
If `search_inference_id` is specified, the {infer} endpoint defined by `inference_id` will only be used at index time.
4668

69+
`search_inference_id`::
70+
(Optional, string)
71+
{infer-cap} endpoint that will be used to generate embeddings at query time.
72+
Use the <<put-inference-api>> to create the endpoint.
73+
If not specified, the {infer} endpoint defined by `inference_id` will be used at both index and query time.
4774

4875
[discrete]
4976
[[infer-endpoint-validation]]
@@ -55,6 +82,7 @@ When the first document is indexed, the `inference_id` will be used to generate
5582
WARNING: Removing an {infer} endpoint will cause ingestion of documents and semantic queries to fail on indices that define `semantic_text` fields with that {infer} endpoint as their `inference_id`.
5683
Trying to <<delete-inference-api,delete an {infer} endpoint>> that is used on a `semantic_text` field will result in an error.
5784

85+
5886
[discrete]
5987
[[auto-text-chunking]]
6088
==== Automatic text chunking
@@ -183,6 +211,7 @@ PUT test-index/_bulk
183211

184212
Notice that both the `semantic_text` field and the source field are updated in the bulk request.
185213

214+
186215
[discrete]
187216
[[limitations]]
188217
==== Limitations

0 commit comments

Comments
 (0)