public class SuggestionParser extends Object implements ComplexDataParser<List<Suggestion>>
This parser converts the response from the Redis FT.SUGGET command into a list of Suggestion objects. The FT.SUGGET
command can return different formats depending on the options used:
Suggestion text and payloads are decoded as UTF-8. Scores are read as RESP3 numbers or RESP2 UTF-8 strings.
| Constructor and Description |
|---|
SuggestionParser(boolean withScores,
boolean withPayloads)
Create a new suggestion parser.
|
| Modifier and Type | Method and Description |
|---|---|
List<Suggestion> |
parse(ComplexData data)
Parse the output of the Redis FT.SUGGET command and convert it to a list of
Suggestion objects. |
public SuggestionParser(boolean withScores,
boolean withPayloads)
withScores - whether the response includes scoreswithPayloads - whether the response includes payloadspublic List<Suggestion> parse(ComplexData data)
Suggestion objects.
The parsing logic depends on the options used with the FT.SUGGET command:
parse in interface ComplexDataParser<List<Suggestion>>data - output of FT.SUGGET commandSuggestion objectsCopyright © 2026 lettuce.io. All rights reserved.