Skip to content

Commit ddbc2b5

Browse files
kderussoMikep86
andauthored
[8.19] Update semantic text docs to include index_options (#130031)
* Update docs for 8.19 * Update docs/reference/mapping/types/semantic-text.asciidoc Co-authored-by: Mike Pellegrini <[email protected]> * PR feedback --------- Co-authored-by: Mike Pellegrini <[email protected]>
1 parent 79f8140 commit ddbc2b5

File tree

1 file changed

+40
-9
lines changed

1 file changed

+40
-9
lines changed

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

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@ You can update this parameter by using the <<indices-put-mapping, Update mapping
9696
Use the <<put-inference-api>> to create the endpoint.
9797
If not specified, the {infer} endpoint defined by `inference_id` will be used at both index and query time.
9898

99+
`index_options`::
100+
(Optional, object) Specifies the index options to override default values for the field.
101+
Currently, `dense_vector` index options are supported.
102+
For text embeddings, `index_options` may match any allowed <<dense-vector-index-options,dense vector index options>>.
103+
99104
`chunking_settings`::
100105
(Optional, object) Settings for chunking text into smaller passages.
101106
If specified, these will override the chunking settings set in the {infer-cap} endpoint associated with `inference_id`.
@@ -124,9 +129,8 @@ The number of overlapping words allowed in chunks.
124129
Valid values are `0` or `1`.
125130
Required for `sentence` type chunking settings.
126131
127-
WARNING: If the input exceeds the maximum token limit of the underlying model, some services (such as OpenAI) may return an
128-
error. In contrast, the `elastic` and `elasticsearch` services will automatically truncate the input to fit within the
129-
model's limit.
132+
WARNING: When using the `none` chunking strategy, if the input exceeds the maximum token limit of the underlying model, some services (such as OpenAI) may return an error.
133+
In contrast, the `elastic` and `elasticsearch` services will automatically truncate the input to fit within the model's limit.
130134
131135
====
132136

@@ -258,12 +262,39 @@ PUT test-index
258262
`semantic_text` uses defaults for indexing data based on the {infer} endpoint specified.
259263
It enables you to quickstart your semantic search by providing automatic {infer} and a dedicated query so you don't need to provide further details.
260264

261-
In case you want to customize data indexing, use the
262-
<<sparse-vector,`sparse_vector`>> or <<dense-vector,`dense_vector`>> field types and create an ingest pipeline with an
263-
<<inference-processor, {infer} processor>> to generate the embeddings.
264-
<<semantic-search-inference,This tutorial>> walks you through the process.
265-
In these cases - when you use `sparse_vector` or `dense_vector` field types instead of the `semantic_text` field type to customize indexing - using the
266-
<<query-dsl-semantic-query,`semantic_query`>> is not supported for querying the field data.
265+
If you want to override those defaults and customize the embeddings that
266+
`semantic_text` indexes, you can do so by modifying <<semantic-text-params, parameters>>:
267+
268+
- Use `index_options` to specify alternate index options such as specific
269+
`dense_vector` quantization methods
270+
- Use `chunking_settings` to override the chunking strategy associated with the
271+
{{infer}} endpoint, or completely disable chunking using the `none` type
272+
273+
Here is an example of how to set these parameters for a text embedding endpoint:
274+
275+
[source,console]
276+
------------------------------------------------------------
277+
PUT my-index-000004
278+
{
279+
"mappings": {
280+
"properties": {
281+
"inference_field": {
282+
"type": "semantic_text",
283+
"inference_id": "my-text-embedding-endpoint",
284+
"index_options": {
285+
"dense_vector": {
286+
"type": "int4_flat"
287+
}
288+
},
289+
"chunking_settings": {
290+
"type": "none"
291+
}
292+
}
293+
}
294+
}
295+
}
296+
------------------------------------------------------------
297+
// TEST[skip:Requires inference endpoint]
267298

268299
[discrete]
269300
[[update-script]]

0 commit comments

Comments
 (0)