Skip to content

Commit 16950d0

Browse files
committed
update ft.info to actually work + with newest options
1 parent 1a5ac15 commit 16950d0

File tree

2 files changed

+295
-156
lines changed

2 files changed

+295
-156
lines changed

packages/search/lib/commands/INFO.spec.ts

Lines changed: 87 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,92 @@ describe('INFO', () => {
1515
await client.ft.create('index', {
1616
field: SCHEMA_FIELD_TYPE.TEXT
1717
});
18-
const reply = await client.ft.info('index');
19-
assert.deepEqual(reply.indexName, 'index');
20-
assert.deepEqual(reply.indexOptions, []);
21-
assert.deepEqual(reply.numDocs, '0');
18+
assert.deepEqual(
19+
await client.ft.info('index'),
20+
{
21+
indexName: 'index',
22+
indexOptions: [],
23+
indexDefinition: Object.create(null, {
24+
default_score: {
25+
value: '1',
26+
configurable: true,
27+
enumerable: true
28+
},
29+
key_type: {
30+
value: 'HASH',
31+
configurable: true,
32+
enumerable: true
33+
},
34+
prefixes: {
35+
value: [''],
36+
configurable: true,
37+
enumerable: true
38+
}
39+
}),
40+
attributes: [Object.create(null, {
41+
identifier: {
42+
value: 'field',
43+
configurable: true,
44+
enumerable: true
45+
},
46+
attribute: {
47+
value: 'field',
48+
configurable: true,
49+
enumerable: true
50+
},
51+
type: {
52+
value: 'TEXT',
53+
configurable: true,
54+
enumerable: true
55+
},
56+
WEIGHT: {
57+
value: '1',
58+
configurable: true,
59+
enumerable: true
60+
}
61+
})],
62+
numDocs: 0,
63+
maxDocId: 0,
64+
numTerms: 0,
65+
numRecords: 0,
66+
invertedSzMb: 0,
67+
vectorIndexSzMb: 0,
68+
totalInvertedIndexBlocks: 0,
69+
offsetVectorsSzMb: 0,
70+
docTableSizeMb: 0,
71+
sortableValuesSizeMb: 0,
72+
keyTableSizeMb: 0,
73+
recordsPerDocAvg: NaN,
74+
bytesPerRecordAvg: NaN,
75+
cleaning: 0,
76+
offsetsPerTermAvg: NaN,
77+
offsetBitsPerRecordAvg: NaN,
78+
geoshapeSizeMb: 0,
79+
hashIndexingFailures: 0,
80+
indexing: 0,
81+
percentIndexed: 1,
82+
numberOfUses: 1,
83+
tagOverheadSizeMb: 0,
84+
textOverheadSizeMb: 0,
85+
totalIndexMemorySizeMb: 0,
86+
totalIndexingTime: 0,
87+
gcStats: {
88+
bytesCollected: 0,
89+
totalMsRun: 0,
90+
totalCycles: 0,
91+
averageCycleTimeMs: NaN,
92+
lastRunTimeMs: 0,
93+
gcNumericTreesMissed: 0,
94+
gcBlocksDenied: 0
95+
},
96+
cursorStats: {
97+
globalIdle: 0,
98+
globalTotal: 0,
99+
indexCapacity: 128,
100+
indexTotal: 0
101+
},
102+
stopWords: undefined
103+
}
104+
);
22105
}, GLOBAL.SERVERS.OPEN);
23106
});

0 commit comments

Comments
 (0)