Search code examples
redisearch

What FRAGS argument does in RediSearch FT.SEARCH command?


I looked through RediSearch documentation and the syntax of FT.SEARCH below:

FT.SEARCH {index} {query} [NOCONTENT] [VERBATIM] [NOSTOPWORDS] [WITHSCORES] [WITHPAYLOADS] [WITHSORTKEYS]
  [FILTER {numeric_field} {min} {max}] ...
  [GEOFILTER {geo_field} {lon} {lat} {raius} m|km|mi|ft]
  [INKEYS {num} {key} ... ]
  [INFIELDS {num} {field} ... ]
  [RETURN {num} {field} ... ]
  [SUMMARIZE [FIELDS {num} {field} ... ] [FRAGS {num}] [LEN {fragsize}] [SEPARATOR {separator}]]
  [HIGHLIGHT [FIELDS {num} {field} ... ] [TAGS {open} {close}]]
  [SLOP {slop}] [INORDER]
  [LANGUAGE {language}]
  [EXPANDER {expander}]
  [SCORER {scorer}]
  [PAYLOAD {payload}]
  [SORTBY {field} [ASC|DESC]]
  [LIMIT offset num]

I cannot find anywhere description of FRAGS. What FRAGS argument does in RediSearch FT.SEARCH command? Is there any limit for {num} parameter?


Solution

  • a fragment is a substring of the search result which contains contextual information related to the search term; for example, when searching for "Redis", a fragment in a document might be

    "found. Users liked Redis more than other..."

    This is part of the summarization feature