Skip to content

Commit e1b935c

Browse files
committed
small tweak for stopWords
1 parent 16950d0 commit e1b935c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { strict as assert } from 'node:assert';
22
import testUtils, { GLOBAL } from '../test-utils';
3-
import INFO from './INFO';
3+
import INFO, { InfoReply } from './INFO';
44
import { SCHEMA_FIELD_TYPE } from './CREATE';
55

66
describe('INFO', () => {
@@ -15,8 +15,10 @@ describe('INFO', () => {
1515
await client.ft.create('index', {
1616
field: SCHEMA_FIELD_TYPE.TEXT
1717
});
18+
const ret = await client.ft.info('index');
19+
assert.deepEqual(ret.stopWords, undefined);
1820
assert.deepEqual(
19-
await client.ft.info('index'),
21+
ret,
2022
{
2123
indexName: 'index',
2224
indexOptions: [],
@@ -99,8 +101,8 @@ describe('INFO', () => {
99101
indexCapacity: 128,
100102
indexTotal: 0
101103
},
102-
stopWords: undefined
103104
}
104105
);
106+
105107
}, GLOBAL.SERVERS.OPEN);
106108
});

packages/search/lib/commands/INFO.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,14 @@ export interface InfoReply {
6060
indexCapacity: NumberReply;
6161
indexTotal: NumberReply;
6262
};
63-
stopWords: ArrayReply<BlobStringReply | NullReply> | undefined;
63+
stopWords?: ArrayReply<BlobStringReply | NullReply>;
6464
}
6565

6666
function transformV2Reply(reply: Array<any>, preserve?: any, typeMapping?: TypeMapping): InfoReply {
6767
const myTransformFunc = createTransformTuplesReplyFunc<SimpleStringReply>(preserve, typeMapping);
6868

6969
const ret = {} as unknown as InfoReply;
7070

71-
ret.stopWords = undefined;
72-
7371
for (let i=0; i < reply.length; i += 2) {
7472
const key = reply[i].toString();
7573

0 commit comments

Comments
 (0)