mirror of https://mirror.osredm.com/root/redis.git
VINFO: use a single field for random projection info.
This commit is contained in:
parent
8f479b22b9
commit
aa92b37589
16
vset.c
16
vset.c
|
@ -1268,12 +1268,8 @@ int VINFO_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv, int argc)
|
|||
|
||||
struct vsetObject *vset = RedisModule_ModuleTypeGetValue(key);
|
||||
|
||||
/* Calculate map size based on projection presence */
|
||||
int map_size = 8; /* Base fields */
|
||||
if (vset->proj_matrix) map_size += 2; /* Additional fields for projection */
|
||||
|
||||
/* Reply with hash */
|
||||
RedisModule_ReplyWithMap(ctx, map_size);
|
||||
RedisModule_ReplyWithMap(ctx, 9);
|
||||
|
||||
/* Quantization type */
|
||||
RedisModule_ReplyWithSimpleString(ctx, "quant-type");
|
||||
|
@ -1287,17 +1283,11 @@ int VINFO_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv, int argc)
|
|||
RedisModule_ReplyWithSimpleString(ctx, "vector-dim");
|
||||
RedisModule_ReplyWithLongLong(ctx, vset->hnsw->vector_dim);
|
||||
|
||||
/* Add projection information if present */
|
||||
if (vset->proj_matrix) {
|
||||
/* Original input dimension before projection */
|
||||
/* Original input dimension before projection.
|
||||
* This is zero for vector sets without a random projection matrix. */
|
||||
RedisModule_ReplyWithSimpleString(ctx, "projection-input-dim");
|
||||
RedisModule_ReplyWithLongLong(ctx, vset->proj_input_size);
|
||||
|
||||
/* Projection enabled flag */
|
||||
RedisModule_ReplyWithSimpleString(ctx, "projection-enabled");
|
||||
RedisModule_ReplyWithBool(ctx, 1);
|
||||
}
|
||||
|
||||
/* Number of elements. */
|
||||
RedisModule_ReplyWithSimpleString(ctx, "size");
|
||||
RedisModule_ReplyWithLongLong(ctx, vset->hnsw->node_count);
|
||||
|
|
Loading…
Reference in New Issue