dragonfly icon indicating copy to clipboard operation
dragonfly copied to clipboard

Implement FT.ADD, FT.DEL, FT.GET, FT.MGET, FT.DROP

Open vyavdoshenko opened this issue 2 months ago • 0 comments

Implement deprecated commands as wrappers over existing commands to enable backward compatibility.

Commands to implement:

FT.ADD - Add document to index Syntax: FT.ADD {index} {docId} {score} FIELDS {field} {value} [{field} {value}...]

Implementation:

  1. Get index prefix from DocIndex
  2. Build key: prefix + docId
  3. Call HSET {key} {field} {value} ...
  4. Return "OK"

FT.GET - Retrieve document from index Syntax: FT.GET {index} {docId}

Implementation:

  1. Get index prefix from DocIndex
  2. Build key: prefix + docId
  3. Call HGETALL {key}
  4. Return result (or Nil if not found)

FT.MGET - Retrieve multiple documents Syntax: FT.MGET {index} {docId} [{docId} ...]

Implementation:

  1. Loop through each docId
  2. Call FT.GET for each
  3. Return an array of results

FT.DEL - Delete document from index Syntax: FT.DEL {index} {docId} [DD]

Implementation:

  1. Get index prefix from DocIndex
  2. Build key: prefix + docId
  3. Call DEL {key} (if DD flag present)
  4. Return 1 if deleted, 0 otherwise

FT.DROP {index} Alias to existing FT.DROPINDEX

These commands are deprecated since RediSearch 2.0, but still maintained for backwards compatibility.

vyavdoshenko avatar Oct 24 '25 13:10 vyavdoshenko