Skip to content

Commit

Permalink
update ft.info to actually work + with newest options
Browse files Browse the repository at this point in the history
  • Loading branch information
sjpotter committed Oct 9, 2024
1 parent 1a5ac15 commit 16950d0
Show file tree
Hide file tree
Showing 2 changed files with 295 additions and 156 deletions.
91 changes: 87 additions & 4 deletions packages/search/lib/commands/INFO.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,92 @@ describe('INFO', () => {
await client.ft.create('index', {
field: SCHEMA_FIELD_TYPE.TEXT
});
const reply = await client.ft.info('index');
assert.deepEqual(reply.indexName, 'index');
assert.deepEqual(reply.indexOptions, []);
assert.deepEqual(reply.numDocs, '0');
assert.deepEqual(
await client.ft.info('index'),
{
indexName: 'index',
indexOptions: [],
indexDefinition: Object.create(null, {
default_score: {
value: '1',
configurable: true,
enumerable: true
},
key_type: {
value: 'HASH',
configurable: true,
enumerable: true
},
prefixes: {
value: [''],
configurable: true,
enumerable: true
}
}),
attributes: [Object.create(null, {
identifier: {
value: 'field',
configurable: true,
enumerable: true
},
attribute: {
value: 'field',
configurable: true,
enumerable: true
},
type: {
value: 'TEXT',
configurable: true,
enumerable: true
},
WEIGHT: {
value: '1',
configurable: true,
enumerable: true
}
})],
numDocs: 0,
maxDocId: 0,
numTerms: 0,
numRecords: 0,
invertedSzMb: 0,
vectorIndexSzMb: 0,
totalInvertedIndexBlocks: 0,
offsetVectorsSzMb: 0,
docTableSizeMb: 0,
sortableValuesSizeMb: 0,
keyTableSizeMb: 0,
recordsPerDocAvg: NaN,
bytesPerRecordAvg: NaN,
cleaning: 0,
offsetsPerTermAvg: NaN,
offsetBitsPerRecordAvg: NaN,
geoshapeSizeMb: 0,
hashIndexingFailures: 0,
indexing: 0,
percentIndexed: 1,
numberOfUses: 1,
tagOverheadSizeMb: 0,
textOverheadSizeMb: 0,
totalIndexMemorySizeMb: 0,
totalIndexingTime: 0,
gcStats: {
bytesCollected: 0,
totalMsRun: 0,
totalCycles: 0,
averageCycleTimeMs: NaN,
lastRunTimeMs: 0,
gcNumericTreesMissed: 0,
gcBlocksDenied: 0
},
cursorStats: {
globalIdle: 0,
globalTotal: 0,
indexCapacity: 128,
indexTotal: 0
},
stopWords: undefined
}
);
}, GLOBAL.SERVERS.OPEN);
});
Loading

0 comments on commit 16950d0

Please sign in to comment.