dragonflydb / dragonflydb/dragonfly
Implement FT.DICTADD, FT.DICTDEL, and FT.DICTDUMP
- Dominant language
- C++
- Stars
- 31.5k
- Forks
- 1.3k
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 137
Description
A set of dictionary management commands - `FT.DICTADD`, `FT.DICTDEL`, and `FT.DICTDUMP` - allows users to create, modify, and inspect user-defined dictionaries.
These dictionaries are essential for advanced text processing use cases such as synonym management, morphological normalization, and autocomplete term handling.
Currently, Dragonfly does not implement these commands, which limits compatibility with features (such as `FT.SYNADD` and `FT.SYNUPDATE`).
Expected behavior:
`FT.DICTADD` [term2 ...]
- Adds one or more terms to the given dictionary.
- If the dictionary does not exist, it is created automatically.
- Returns the number of newly added terms (duplicates are ignored).
`FT.DICTDEL` [term2 ...]
- Removes one or more terms from the specified dictionary.
- Returns the number of terms actually removed.
`FT.DICTDUMP`
- Returns all terms currently stored in the dictionary as an array of strings.
Use cases:
- Build custom synonym or keyword dictionaries for full-text search.
- Support` FT.SYNADD` / `FT.SYNUPDATE` synonym groups using predefined term sets.
- Maintain specialized vocabularies for domain-specific search logic.
Also should be related to: `FT.SUGADD`, `FT.SUGGET`, `FT.SUGDEL`, `FT.SUGLEN`
Contributor guide
Research direction
Start by locating the existing FT.SYNADD, FT.SYNUPDATE, FT.SUGADD, FT.SUGGET, FT.SUGDEL, and FT.SUGLEN command implementations and their tests. Use those as the integration points, then verify that the three dictionary commands create dictionaries as needed, ignore duplicate additions, report removals, and dump stored terms as specified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- databases, search
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100