acodeninja / modern-tools-for-social-care

An ecosystem of tools for social care management.
0 stars 0 forks source link

Be able to highlight text in responses according to matching terms #22

Closed acodeninja closed 2 years ago

acodeninja commented 2 years ago

What does it do now?

Does not return the results with highlighting for the terms entered.

What should it do?

Return results with highlighting for the terms.

jhackett1 commented 2 years ago

example

https://github.com/LBHackney-IT/lbh-social-care-next-gen-search/blob/main/pages/api/search.ts#L66-L74

            highlight: {
              type: "fvh",
              pre_tags: "<strong>",
              post_tags: "</strong>",
              fields: {
                content: {},
                "content.exact": {},
              },
            },

we want to use the fvh highlighter and <strong/> tags to wrap the highlighted text