Skip to content

Commit bd2d070

Browse files
committed
Remove outdated reference to internal semantic text format
The semantic text format was updated in #119183. This commit removes the last remaining reference to the old format from the documentation to ensure consistency.
1 parent c8dfb4e commit bd2d070

File tree

1 file changed

+15
-29
lines changed

1 file changed

+15
-29
lines changed

docs/reference/search/search-your-data/semantic-text-hybrid-search

Lines changed: 15 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ POST _tasks/<task_id>/_cancel
113113
==== Perform hybrid search
114114

115115
After reindexing the data into the `semantic-embeddings` index, you can perform hybrid search by using <<rrf,reciprocal rank fusion (RRF)>>. 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.
116+
To extract the most relevant fragments from the original text and query, you can use the <<highlighting,highlight parameter>>:
116117

117118
[source,console]
118119
------------------------------------------------------------
@@ -142,6 +143,13 @@ GET semantic-embeddings/_search
142143
}
143144
]
144145
}
146+
},
147+
"highlight": {
148+
"fields": {
149+
"semantic_text": {
150+
"number_of_fragments": 2 <5>
151+
}
152+
}
145153
}
146154
}
147155
------------------------------------------------------------
@@ -150,7 +158,7 @@ GET semantic-embeddings/_search
150158
<2> Lexical search is performed on the `content` field using the specified phrase.
151159
<3> The second `standard` retriever refers to the semantic search.
152160
<4> The `semantic_text` field is used to perform the semantic search.
153-
161+
<5> Specifies the maximum number of fragments to return. See <<semantic-text-highlighting, semantic text highlighting>> for a more complete example.
154162

155163
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:
156164

@@ -178,36 +186,14 @@ After performing the hybrid search, the query will return the top 10 documents t
178186
"_score": 0.032786883,
179187
"_rank": 1,
180188
"_source": {
181-
"semantic_text": {
182-
"inference": {
183-
"inference_id": "my-elser-endpoint",
184-
"model_settings": {
185-
"task_type": "sparse_embedding"
186-
},
187-
"chunks": [
188-
{
189-
"text": "What so many out there do not realize is the importance of what you do after you work out. You may have done the majority of the work, but how you treat your body in the minutes and hours after you exercise has a direct effect on muscle soreness, muscle strength and growth, and staying hydrated. Cool Down. After your last exercise, your workout is not over. The first thing you need to do is cool down. Even if running was all that you did, you still should do light cardio for a few minutes. This brings your heart rate down at a slow and steady pace, which helps you avoid feeling sick after a workout.",
190-
"embeddings": {
191-
"exercise": 1.571044,
192-
"after": 1.3603843,
193-
"sick": 1.3281639,
194-
"cool": 1.3227621,
195-
"muscle": 1.2645415,
196-
"sore": 1.2561599,
197-
"cooling": 1.2335974,
198-
"running": 1.1750668,
199-
"hours": 1.1104802,
200-
"out": 1.0991782,
201-
"##io": 1.0794281,
202-
"last": 1.0474665,
203-
(...)
204-
}
205-
}
206-
]
207-
}
208-
},
209189
"id": 8408852,
210190
"content": "What so many out there do not realize is the importance of (...)"
191+
},
192+
"highlight" : {
193+
"semantic_text" : [
194+
"... fragment_1 ...",
195+
"... fragment_2 ..."
196+
]
211197
}
212198
}
213199
]

0 commit comments

Comments
 (0)