1
0
mirror of https://github.com/redis/node-redis.git synced 2025-12-12 21:21:15 +03:00
Files
node-redis/packages/search/lib/commands/SEARCH_NOCONTENT.ts
Bobby I. 20c16e0c2c (docs) add jsdoc comments to command parsers (#2984)
* (docs) bloom: add jsdocs for all commands

* (docs) json: add jsdocs

* (docs) search: add jsdocs for all commands

* (docs) jsdocs for std commands

* (docs) jsdoc comments to time series commands
2025-06-03 14:38:07 +03:00

34 lines
1.0 KiB
TypeScript

import { Command, ReplyUnion } from '@redis/client/dist/lib/RESP/types';
import SEARCH, { SearchRawReply } from './SEARCH';
export default {
NOT_KEYED_COMMAND: SEARCH.NOT_KEYED_COMMAND,
IS_READ_ONLY: SEARCH.IS_READ_ONLY,
/**
* Performs a search query but returns only document ids without their contents.
* @param args - Same parameters as FT.SEARCH:
* - parser: The command parser
* - index: Name of the index to search
* - query: The text query to search
* - options: Optional search parameters
*/
parseCommand(...args: Parameters<typeof SEARCH.parseCommand>) {
SEARCH.parseCommand(...args);
args[0].push('NOCONTENT');
},
transformReply: {
2: (reply: SearchRawReply): SearchNoContentReply => {
return {
total: reply[0],
documents: reply.slice(1)
}
},
3: undefined as unknown as () => ReplyUnion
},
unstableResp3: true
} as const satisfies Command;
export interface SearchNoContentReply {
total: number;
documents: Array<string>;
};