Skip to content

FT.CREATE builds invalid FT.CREATE for VECTOR fields when INDEXMISSING: true #3170

@PavelPashov

Description

@PavelPashov

Description

When using client.ft.create() to create an index schema containing a VECTOR field with INDEXMISSING: true, the client serializes the FT.CREATE command with INDEXMISSING immediately after VECTOR, before the required vector algorithm token (HNSW/FLAT). Redis expects the algorithm to follow VECTOR positionally, so the generated command is invalid and fails.

await client.ft.create(
  'idx:example',
  {
    vector1: {
      type: 'VECTOR',
      ALGORITHM: 'HNSW',
      TYPE: 'FLOAT32',
      DIM: 5,
      DISTANCE_METRIC: 'L2',
      INDEXMISSING: true,
    },
  },
  { ON: 'HASH' }
);

Actual Generated Command

"FT.CREATE" "idx:example" "ON" "HASH" "SCHEMA"
"vector1" "VECTOR" "INDEXMISSING" "HNSW" "6"
"TYPE" "FLOAT32" "DIM" "5" "DISTANCE_METRIC" "L2"

Expected Generated Command

"FT.CREATE" "idx:example" "ON" "HASH" "SCHEMA"
"vector1" "VECTOR" "HNSW" "6"
"TYPE" "FLOAT32" "DIM" "5" "DISTANCE_METRIC" "L2"
"INDEXMISSING"

Node.js Version

24

Redis Server Version

8.4

Node Redis Version

5.10.0

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions