typesense / typesense/typesense

Shows multiple highlight snippets for a string field

Open
#152 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
26.6k
Forks
973
Avg merge
18h 45m
Merged PRs (30d)
4

Description

Typsense Version: v0.16.1

Hello, and thank you for this great search engine. I am attempting to use typesense to implement a search of book chapters, which have a field like {'name': 'data', 'type': 'string'}. I am wondering if it would be possible to have snippets returned for all matching <mark>ed portions of the text. A result looks like this (for example with query the, and highlight_full_fields=data):
image

The snippet returns a match, but there are other matches in the value that are also <mark>ed. As a workaround, I am able to extract the <mark>ed portions out of the full field value and create my own snippets, but this seems like it would be a worthwhile feature to have directly in typesense, and with chapter-length text, the size of payloads returned from typesense becomes non-trivial.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how highlight_full_fields=data produces the snippet and full-field value for string fields. Confirm how multiple <mark>ed matches are represented, then define completion as returning snippets for all matching portions without unnecessarily increasing chapter-sized payloads.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
search
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.