quickwit icon indicating copy to clipboard operation
quickwit copied to clipboard

Add support for snippetting.

Open fulmicoton opened this issue 1 year ago • 1 comments

Tantivy offers a way to return a sample of the documents that contains some passage containiing the matched keywords.

It would be nice to add this feature to quickwit's API.

fulmicoton avatar Jul 25 '22 02:07 fulmicoton

I would go with :

  • Rest: https://quickwit-host/api/v1/hdfs/search?query=body:foo&snippet_fields=body
  • Cli: .quickwit index search --query "body:foo" --snippet_field body

The following checks need to happen during search:

  • Does snippet_field appear in the query or part of the default search fields?
  • Is snippet_field of field type that supports snippeting (text, indexed ..) ?
  • Serialise the snippet

evanxg852000 avatar Jul 29 '22 16:07 evanxg852000