-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Clarify highlighting docs for semantic_text and interacting with chunks #131871
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify highlighting docs for semantic_text and interacting with chunks #131871
Conversation
Pinging @elastic/es-docs (Team:Docs) |
Pinging @elastic/search-eng (Team:SearchOrg) |
Pinging @elastic/search-relevance (Team:Search - Relevance) |
POST test-index/_search | ||
{ | ||
"query": { | ||
"match_all": {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Samiul-TheSoccerFan what version should this be tagged with?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was backported all the way to 8.18
and 9.0
. If you are looking for specific versions, I would say from 8.18.4
and 9.0.4
.
🔍 Preview links for changed docs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the quick turnaround on this, and adding match_all
at the same time!
docs/reference/elasticsearch/mapping-reference/semantic-text.md
Outdated
Show resolved
Hide resolved
docs/reference/elasticsearch/mapping-reference/semantic-text.md
Outdated
Show resolved
Hide resolved
"highlight": { | ||
"fields": { | ||
"my_semantic_field": { | ||
"number_of_fragments": 5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we call out adjusting number_of_fragments
here to a larger number to get all chunks in a doc, and how that will be variable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in 8cae0f6 LMKWYT
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
# Highlighting [highlighting] | ||
|
||
Highlighters enable you to get highlighted snippets from one or more fields in your search results so you can show users where the query matches are. When you request highlights, the response contains an additional `highlight` element for each search hit that includes the highlighted fields and the highlighted fragments. | ||
Highlighters enable you to retrieve the best-matching highlighted snippets from one or more fields in your search results so you can show users where the query matches are. When you request highlights, the response contains an additional `highlight` element for each search hit that includes the highlighted fields and the highlighted fragments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice light-touch change 👍
Co-authored-by: Mike Pellegrini <[email protected]>
Co-authored-by: Mike Pellegrini <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
💔 Backport failed
You can use sqren/backport to manually backport by running |
…ks (elastic#131871) (cherry picked from commit b3510c1)
💔 Some backports could not be created
Manual backportTo create the backport manually run:
Questions ?Please refer to the Backport tool documentation |
Removed backport labels for 8.18 and 8.19 - Markdown doesn't exist there. |
We ran into a confusing use case with the
semantic
highlighter.With the above search, the expectation was that the first snippet would be returned as order was not specified, but in fact the second snippet was returned. This is because we had only asked for one snippet, so only the top scoring snippet was returned.
This clarifies the documentation to show an alternate way to get
semantic
highlighter chunks, in the order in which they appear in the document: