Skip to content

Resolve "Add more context to results"

Hiru Fernando requested to merge 123-add-more-context-to-results into elasticsearch

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:

image

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

image.png

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.

  1. 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.

Closes #123 (closed)

Edited by Hiru Fernando

Merge request reports

Loading