[フレーム]
Docs Pricing
Login Book a meeting Try Redis

FT.SUGADD

Syntax
FT.SUGADD key string score 
 [INCR] 
 [PAYLOAD payload]
Available in:
Redis Open Source / Search 1.0.0
Time complexity:
O(1)
ACL categories:
@search, @write,
Compatibility:
Redis Enterprise and Redis Cloud compatibility

Add a suggestion string to an auto-complete suggestion dictionary

Examples

Required arguments

key

is suggestion dictionary key.

string

is suggestion string to index.

score

is floating point number of the suggestion string's weight.

The auto-complete suggestion dictionary is disconnected from the index definitions and leaves creating and updating suggestions dictionaries to the user.

Optional arguments

INCR

increments the existing entry of the suggestion by the given score, instead of replacing the score. This is useful for updating the dictionary based on user queries in real time.

PAYLOAD {payload}

saves an extra payload with the suggestion, that can be fetched by adding the WITHPAYLOADS argument to FT.SUGGET.

Examples

Add a suggestion string to an auto-complete suggestion dictionary
127.0.0.1:6379> FT.SUGADD sug "hello world" 1
(integer) 3

Redis Enterprise and Redis Cloud compatibility

Redis
Enterprise
Redis
Cloud
Notes
❌ Standard
❌ Active-Active
❌ Standard
❌ Active-Active

Return information

Integer reply: number of elements added to the suggestion dictionary.

See also

FT.SUGGET | FT.SUGDEL | FT.SUGLEN

RediSearch

RATE THIS PAGE
Back to top ↑

AltStyle によって変換されたページ (->オリジナル) /