Resolve "Add more context to results"
What does this MR do and why?
Ideally a summary would've been coming from the following field. However we don't have tags with name="description"
. Elastic search uses this to send back summary of the html document:
The other option was using highlight
(this following can be used to test in the console"
GET /search-gitlab-docs-hugo/_search
{
"query": {
"match": {
"body_content": "git push"
}
},
"highlight": {
"fields": {
"body_content": {}
}
}
}
The following provides an array of snippets.
So I just used the first item in that array to display the "summary".
The result looks like this
Screenshots, screen recordings, or links to review app
These are strongly recommended to assist reviewers and reduce the time to merge your change.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
-
Configure a local GitLab Docs environment: https://gitlab.com/gitlab-org/technical-writing-group/gitlab-docs-hugo/-/blob/main/doc/setup.md.
Merge request acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this merge request.
Closes #123 (closed)