Skip to content

Commit fa77a51

Browse files
committed
Remove references to the legacy format in docs
1 parent 2fc41ec commit fa77a51

File tree

2 files changed

+1
-159
lines changed

2 files changed

+1
-159
lines changed

docs/reference/query-dsl/semantic-query.asciidoc

Lines changed: 0 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -117,79 +117,3 @@ GET my-index/_search
117117
}
118118
------------------------------------------------------------
119119
// TEST[skip: Requires inference endpoints]
120-
121-
122-
[discrete]
123-
[[advanced-search]]
124-
==== Advanced search on `semantic_text` fields
125-
126-
The `semantic` query uses default settings for searching on `semantic_text` fields for ease of use.
127-
If you want to fine-tune a search on a `semantic_text` field, you need to know the task type used by the `inference_id` configured in `semantic_text`.
128-
You can find the task type using the <<get-inference-api>>, and check the `task_type` associated with the {infer} service.
129-
Depending on the `task_type`, use either the <<query-dsl-sparse-vector-query,`sparse_vector`>> or the <<query-dsl-knn-query,`knn`>> query for greater flexibility and customization.
130-
131-
NOTE: While it is possible to use the `sparse_vector` query or the `knn` query
132-
on a `semantic_text` field, it is not supported to use the `semantic_query` on a
133-
`sparse_vector` or `dense_vector` field type.
134-
135-
136-
[discrete]
137-
[[search-sparse-inference]]
138-
===== Search with `sparse_embedding` inference
139-
140-
When the {infer} endpoint uses a `sparse_embedding` model, you can use a <<query-dsl-sparse-vector-query,`sparse_vector` query>> on a <<semantic-text,`semantic_text`>> field in the following way:
141-
142-
[source,console]
143-
------------------------------------------------------------
144-
GET test-index/_search
145-
{
146-
"query": {
147-
"nested": {
148-
"path": "inference_field.inference.chunks",
149-
"query": {
150-
"sparse_vector": {
151-
"field": "inference_field.inference.chunks.embeddings",
152-
"inference_id": "my-inference-id",
153-
"query": "mountain lake"
154-
}
155-
}
156-
}
157-
}
158-
}
159-
------------------------------------------------------------
160-
// TEST[skip: Requires inference endpoints]
161-
162-
You can customize the `sparse_vector` query to include specific settings, like <<sparse-vector-query-with-pruning-config-and-rescore-example,pruning configuration>>.
163-
164-
165-
[discrete]
166-
[[search-text-inferece]]
167-
===== Search with `text_embedding` inference
168-
169-
When the {infer} endpoint uses a `text_embedding` model, you can use a <<query-dsl-knn-query,`knn` query>> on a `semantic_text` field in the following way:
170-
171-
[source,console]
172-
------------------------------------------------------------
173-
GET test-index/_search
174-
{
175-
"query": {
176-
"nested": {
177-
"path": "inference_field.inference.chunks",
178-
"query": {
179-
"knn": {
180-
"field": "inference_field.inference.chunks.embeddings",
181-
"query_vector_builder": {
182-
"text_embedding": {
183-
"model_id": "my_inference_id",
184-
"model_text": "mountain lake"
185-
}
186-
}
187-
}
188-
}
189-
}
190-
}
191-
}
192-
------------------------------------------------------------
193-
// TEST[skip: Requires inference endpoints]
194-
195-
You can customize the `knn` query to include specific settings, like `num_candidates` and `k`.

docs/reference/search/search-your-data/semantic-search-semantic-text.asciidoc

Lines changed: 1 addition & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -157,89 +157,7 @@ GET semantic-embeddings/_search
157157
<2> The query text.
158158

159159
As a result, you receive the top 10 documents that are closest in meaning to the
160-
query from the `semantic-embedding` index:
161-
162-
[source,console-result]
163-
------------------------------------------------------------
164-
"hits": [
165-
{
166-
"_index": "semantic-embeddings",
167-
"_id": "Jy5065EBBFPLbFsdh_f9",
168-
"_score": 21.487484,
169-
"_source": {
170-
"id": 8836652,
171-
"content": {
172-
"text": "There are a few foods and food groups that will help to fight inflammation and delayed onset muscle soreness (both things that are inevitable after a long, hard workout) when you incorporate them into your postworkout eats, whether immediately after your run or at a meal later in the day. Advertisement. Advertisement.",
173-
"inference": {
174-
"inference_id": "my-elser-endpoint",
175-
"model_settings": {
176-
"task_type": "sparse_embedding"
177-
},
178-
"chunks": [
179-
{
180-
"text": "There are a few foods and food groups that will help to fight inflammation and delayed onset muscle soreness (both things that are inevitable after a long, hard workout) when you incorporate them into your postworkout eats, whether immediately after your run or at a meal later in the day. Advertisement. Advertisement.",
181-
"embeddings": {
182-
(...)
183-
}
184-
}
185-
]
186-
}
187-
}
188-
}
189-
},
190-
{
191-
"_index": "semantic-embeddings",
192-
"_id": "Ji5065EBBFPLbFsdh_f9",
193-
"_score": 18.211695,
194-
"_source": {
195-
"id": 8836651,
196-
"content": {
197-
"text": "During Your Workout. There are a few things you can do during your workout to help prevent muscle injury and soreness. According to personal trainer and writer for Iron Magazine, Marc David, doing warm-ups and cool-downs between sets can help keep muscle soreness to a minimum.",
198-
"inference": {
199-
"inference_id": "my-elser-endpoint",
200-
"model_settings": {
201-
"task_type": "sparse_embedding"
202-
},
203-
"chunks": [
204-
{
205-
"text": "During Your Workout. There are a few things you can do during your workout to help prevent muscle injury and soreness. According to personal trainer and writer for Iron Magazine, Marc David, doing warm-ups and cool-downs between sets can help keep muscle soreness to a minimum.",
206-
"embeddings": {
207-
(...)
208-
}
209-
}
210-
]
211-
}
212-
}
213-
}
214-
},
215-
{
216-
"_index": "semantic-embeddings",
217-
"_id": "Wi5065EBBFPLbFsdh_b9",
218-
"_score": 13.089405,
219-
"_source": {
220-
"id": 8800197,
221-
"content": {
222-
"text": "This is especially important if the soreness is due to a weightlifting routine. For this time period, do not exert more than around 50% of the level of effort (weight, distance and speed) that caused the muscle groups to be sore.",
223-
"inference": {
224-
"inference_id": "my-elser-endpoint",
225-
"model_settings": {
226-
"task_type": "sparse_embedding"
227-
},
228-
"chunks": [
229-
{
230-
"text": "This is especially important if the soreness is due to a weightlifting routine. For this time period, do not exert more than around 50% of the level of effort (weight, distance and speed) that caused the muscle groups to be sore.",
231-
"embeddings": {
232-
(...)
233-
}
234-
}
235-
]
236-
}
237-
}
238-
}
239-
}
240-
]
241-
------------------------------------------------------------
242-
// NOTCONSOLE
160+
query from the `semantic-embedding` index.
243161

244162
[discrete]
245163
[[semantic-text-further-examples]]

0 commit comments

Comments
 (0)