@redis/search 1.0.6 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/AGGREGATE.d.ts +2 -0
- package/dist/commands/AGGREGATE.js +3 -1
- package/dist/commands/AGGREGATE_WITHCURSOR.d.ts +14 -0
- package/dist/commands/AGGREGATE_WITHCURSOR.js +23 -0
- package/dist/commands/CURSOR_DEL.d.ts +4 -0
- package/dist/commands/CURSOR_DEL.js +13 -0
- package/dist/commands/CURSOR_READ.d.ts +5 -0
- package/dist/commands/CURSOR_READ.js +16 -0
- package/dist/commands/index.d.ts +11 -0
- package/dist/commands/index.js +15 -0
- package/package.json +6 -6
|
@@ -100,6 +100,8 @@ export interface AggregateOptions {
|
|
|
100
100
|
PARAMS?: Params;
|
|
101
101
|
DIALECT?: number;
|
|
102
102
|
}
|
|
103
|
+
export declare const FIRST_KEY_INDEX = 1;
|
|
104
|
+
export declare const IS_READ_ONLY = true;
|
|
103
105
|
export declare function transformArguments(index: string, query: string, options?: AggregateOptions): RedisCommandArguments;
|
|
104
106
|
export declare function pushAggregatehOptions(args: RedisCommandArguments, options?: AggregateOptions): RedisCommandArguments;
|
|
105
107
|
export declare type AggregateRawReply = [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.transformReply = exports.pushAggregatehOptions = exports.transformArguments = exports.AggregateGroupByReducers = exports.AggregateSteps = void 0;
|
|
3
|
+
exports.transformReply = exports.pushAggregatehOptions = exports.transformArguments = exports.IS_READ_ONLY = exports.FIRST_KEY_INDEX = exports.AggregateGroupByReducers = exports.AggregateSteps = void 0;
|
|
4
4
|
const generic_transformers_1 = require("@redis/client/dist/lib/commands/generic-transformers");
|
|
5
5
|
const _1 = require(".");
|
|
6
6
|
var AggregateSteps;
|
|
@@ -27,6 +27,8 @@ var AggregateGroupByReducers;
|
|
|
27
27
|
AggregateGroupByReducers["FIRST_VALUE"] = "FIRST_VALUE";
|
|
28
28
|
AggregateGroupByReducers["RANDOM_SAMPLE"] = "RANDOM_SAMPLE";
|
|
29
29
|
})(AggregateGroupByReducers = exports.AggregateGroupByReducers || (exports.AggregateGroupByReducers = {}));
|
|
30
|
+
exports.FIRST_KEY_INDEX = 1;
|
|
31
|
+
exports.IS_READ_ONLY = true;
|
|
30
32
|
function transformArguments(index, query, options) {
|
|
31
33
|
return pushAggregatehOptions(['FT.AGGREGATE', index, query], options);
|
|
32
34
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AggregateOptions, AggregateRawReply, AggregateReply } from './AGGREGATE';
|
|
2
|
+
export { FIRST_KEY_INDEX, IS_READ_ONLY } from './AGGREGATE';
|
|
3
|
+
interface AggregateWithCursorOptions extends AggregateOptions {
|
|
4
|
+
COUNT?: number;
|
|
5
|
+
}
|
|
6
|
+
export declare function transformArguments(index: string, query: string, options?: AggregateWithCursorOptions): import("@redis/client/dist/lib/commands").RedisCommandArguments;
|
|
7
|
+
declare type AggregateWithCursorRawReply = [
|
|
8
|
+
result: AggregateRawReply,
|
|
9
|
+
cursor: number
|
|
10
|
+
];
|
|
11
|
+
interface AggregateWithCursorReply extends AggregateReply {
|
|
12
|
+
cursor: number;
|
|
13
|
+
}
|
|
14
|
+
export declare function transformReply(reply: AggregateWithCursorRawReply): AggregateWithCursorReply;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.transformReply = exports.transformArguments = exports.IS_READ_ONLY = exports.FIRST_KEY_INDEX = void 0;
|
|
4
|
+
const AGGREGATE_1 = require("./AGGREGATE");
|
|
5
|
+
var AGGREGATE_2 = require("./AGGREGATE");
|
|
6
|
+
Object.defineProperty(exports, "FIRST_KEY_INDEX", { enumerable: true, get: function () { return AGGREGATE_2.FIRST_KEY_INDEX; } });
|
|
7
|
+
Object.defineProperty(exports, "IS_READ_ONLY", { enumerable: true, get: function () { return AGGREGATE_2.IS_READ_ONLY; } });
|
|
8
|
+
function transformArguments(index, query, options) {
|
|
9
|
+
const args = (0, AGGREGATE_1.transformArguments)(index, query, options);
|
|
10
|
+
args.push('WITHCURSOR');
|
|
11
|
+
if (options?.COUNT) {
|
|
12
|
+
args.push('COUNT', options.COUNT.toString());
|
|
13
|
+
}
|
|
14
|
+
return args;
|
|
15
|
+
}
|
|
16
|
+
exports.transformArguments = transformArguments;
|
|
17
|
+
function transformReply(reply) {
|
|
18
|
+
return {
|
|
19
|
+
...(0, AGGREGATE_1.transformReply)(reply[0]),
|
|
20
|
+
cursor: reply[1]
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
exports.transformReply = transformReply;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { RedisCommandArgument } from '@redis/client/dist/lib/commands';
|
|
2
|
+
export declare const FIRST_KEY_INDEX = 1;
|
|
3
|
+
export declare function transformArguments(index: RedisCommandArgument, cursorId: number): RedisCommandArgument[];
|
|
4
|
+
export declare function transformReply(): 'OK';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.transformArguments = exports.FIRST_KEY_INDEX = void 0;
|
|
4
|
+
exports.FIRST_KEY_INDEX = 1;
|
|
5
|
+
function transformArguments(index, cursorId) {
|
|
6
|
+
return [
|
|
7
|
+
'FT.CURSOR',
|
|
8
|
+
'DEL',
|
|
9
|
+
index,
|
|
10
|
+
cursorId.toString()
|
|
11
|
+
];
|
|
12
|
+
}
|
|
13
|
+
exports.transformArguments = transformArguments;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { RedisCommandArgument, RedisCommandArguments } from '@redis/client/dist/lib/commands';
|
|
2
|
+
export declare const FIRST_KEY_INDEX = 1;
|
|
3
|
+
export declare const IS_READ_ONLY = true;
|
|
4
|
+
export declare function transformArguments(index: RedisCommandArgument, cursor: number): RedisCommandArguments;
|
|
5
|
+
export { transformReply } from './AGGREGATE_WITHCURSOR';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.transformReply = exports.transformArguments = exports.IS_READ_ONLY = exports.FIRST_KEY_INDEX = void 0;
|
|
4
|
+
exports.FIRST_KEY_INDEX = 1;
|
|
5
|
+
exports.IS_READ_ONLY = true;
|
|
6
|
+
function transformArguments(index, cursor) {
|
|
7
|
+
return [
|
|
8
|
+
'FT.CURSOR',
|
|
9
|
+
'READ',
|
|
10
|
+
index,
|
|
11
|
+
cursor.toString()
|
|
12
|
+
];
|
|
13
|
+
}
|
|
14
|
+
exports.transformArguments = transformArguments;
|
|
15
|
+
var AGGREGATE_WITHCURSOR_1 = require("./AGGREGATE_WITHCURSOR");
|
|
16
|
+
Object.defineProperty(exports, "transformReply", { enumerable: true, get: function () { return AGGREGATE_WITHCURSOR_1.transformReply; } });
|
package/dist/commands/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as _LIST from './_LIST';
|
|
2
2
|
import * as ALTER from './ALTER';
|
|
3
|
+
import * as AGGREGATE_WITHCURSOR from './AGGREGATE_WITHCURSOR';
|
|
3
4
|
import * as AGGREGATE from './AGGREGATE';
|
|
4
5
|
import * as ALIASADD from './ALIASADD';
|
|
5
6
|
import * as ALIASDEL from './ALIASDEL';
|
|
@@ -7,6 +8,8 @@ import * as ALIASUPDATE from './ALIASUPDATE';
|
|
|
7
8
|
import * as CONFIG_GET from './CONFIG_GET';
|
|
8
9
|
import * as CONFIG_SET from './CONFIG_SET';
|
|
9
10
|
import * as CREATE from './CREATE';
|
|
11
|
+
import * as CURSOR_DEL from './CURSOR_DEL';
|
|
12
|
+
import * as CURSOR_READ from './CURSOR_READ';
|
|
10
13
|
import * as DICTADD from './DICTADD';
|
|
11
14
|
import * as DICTDEL from './DICTDEL';
|
|
12
15
|
import * as DICTDUMP from './DICTDUMP';
|
|
@@ -35,6 +38,8 @@ declare const _default: {
|
|
|
35
38
|
_list: typeof _LIST;
|
|
36
39
|
ALTER: typeof ALTER;
|
|
37
40
|
alter: typeof ALTER;
|
|
41
|
+
AGGREGATE_WITHCURSOR: typeof AGGREGATE_WITHCURSOR;
|
|
42
|
+
aggregateWithCursor: typeof AGGREGATE_WITHCURSOR;
|
|
38
43
|
AGGREGATE: typeof AGGREGATE;
|
|
39
44
|
aggregate: typeof AGGREGATE;
|
|
40
45
|
ALIASADD: typeof ALIASADD;
|
|
@@ -49,6 +54,10 @@ declare const _default: {
|
|
|
49
54
|
configSet: typeof CONFIG_SET;
|
|
50
55
|
CREATE: typeof CREATE;
|
|
51
56
|
create: typeof CREATE;
|
|
57
|
+
CURSOR_DEL: typeof CURSOR_DEL;
|
|
58
|
+
cursorDel: typeof CURSOR_DEL;
|
|
59
|
+
CURSOR_READ: typeof CURSOR_READ;
|
|
60
|
+
cursorRead: typeof CURSOR_READ;
|
|
52
61
|
DICTADD: typeof DICTADD;
|
|
53
62
|
dictAdd: typeof DICTADD;
|
|
54
63
|
DICTDEL: typeof DICTDEL;
|
|
@@ -153,12 +162,14 @@ declare type CreateSchemaTextField = CreateSchemaCommonField<SchemaFieldTypes.TE
|
|
|
153
162
|
NOSTEM?: true;
|
|
154
163
|
WEIGHT?: number;
|
|
155
164
|
PHONETIC?: SchemaTextFieldPhonetics;
|
|
165
|
+
WITHSUFFIXTRIE?: boolean;
|
|
156
166
|
}>;
|
|
157
167
|
declare type CreateSchemaNumericField = CreateSchemaCommonField<SchemaFieldTypes.NUMERIC>;
|
|
158
168
|
declare type CreateSchemaGeoField = CreateSchemaCommonField<SchemaFieldTypes.GEO>;
|
|
159
169
|
declare type CreateSchemaTagField = CreateSchemaCommonField<SchemaFieldTypes.TAG, {
|
|
160
170
|
SEPARATOR?: string;
|
|
161
171
|
CASESENSITIVE?: true;
|
|
172
|
+
WITHSUFFIXTRIE?: boolean;
|
|
162
173
|
}>;
|
|
163
174
|
export declare enum VectorAlgorithms {
|
|
164
175
|
FLAT = "FLAT",
|
package/dist/commands/index.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.transformProfile = exports.pushSearchOptions = exports.pushParamsArgs = exports.pushSchema = exports.VectorAlgorithms = exports.SchemaTextFieldPhonetics = exports.SchemaFieldTypes = exports.pushArgumentsWithLength = exports.pushSortByArguments = exports.pushSortByProperty = exports.RedisSearchLanguages = void 0;
|
|
4
4
|
const _LIST = require("./_LIST");
|
|
5
5
|
const ALTER = require("./ALTER");
|
|
6
|
+
const AGGREGATE_WITHCURSOR = require("./AGGREGATE_WITHCURSOR");
|
|
6
7
|
const AGGREGATE = require("./AGGREGATE");
|
|
7
8
|
const ALIASADD = require("./ALIASADD");
|
|
8
9
|
const ALIASDEL = require("./ALIASDEL");
|
|
@@ -10,6 +11,8 @@ const ALIASUPDATE = require("./ALIASUPDATE");
|
|
|
10
11
|
const CONFIG_GET = require("./CONFIG_GET");
|
|
11
12
|
const CONFIG_SET = require("./CONFIG_SET");
|
|
12
13
|
const CREATE = require("./CREATE");
|
|
14
|
+
const CURSOR_DEL = require("./CURSOR_DEL");
|
|
15
|
+
const CURSOR_READ = require("./CURSOR_READ");
|
|
13
16
|
const DICTADD = require("./DICTADD");
|
|
14
17
|
const DICTDEL = require("./DICTDEL");
|
|
15
18
|
const DICTDUMP = require("./DICTDUMP");
|
|
@@ -37,6 +40,8 @@ exports.default = {
|
|
|
37
40
|
_list: _LIST,
|
|
38
41
|
ALTER,
|
|
39
42
|
alter: ALTER,
|
|
43
|
+
AGGREGATE_WITHCURSOR,
|
|
44
|
+
aggregateWithCursor: AGGREGATE_WITHCURSOR,
|
|
40
45
|
AGGREGATE,
|
|
41
46
|
aggregate: AGGREGATE,
|
|
42
47
|
ALIASADD,
|
|
@@ -51,6 +56,10 @@ exports.default = {
|
|
|
51
56
|
configSet: CONFIG_SET,
|
|
52
57
|
CREATE,
|
|
53
58
|
create: CREATE,
|
|
59
|
+
CURSOR_DEL,
|
|
60
|
+
cursorDel: CURSOR_DEL,
|
|
61
|
+
CURSOR_READ,
|
|
62
|
+
cursorRead: CURSOR_READ,
|
|
54
63
|
DICTADD,
|
|
55
64
|
dictAdd: DICTADD,
|
|
56
65
|
DICTDEL,
|
|
@@ -198,6 +207,9 @@ function pushSchema(args, schema) {
|
|
|
198
207
|
if (fieldOptions.PHONETIC) {
|
|
199
208
|
args.push('PHONETIC', fieldOptions.PHONETIC);
|
|
200
209
|
}
|
|
210
|
+
if (fieldOptions.WITHSUFFIXTRIE) {
|
|
211
|
+
args.push('WITHSUFFIXTRIE');
|
|
212
|
+
}
|
|
201
213
|
break;
|
|
202
214
|
// case SchemaFieldTypes.NUMERIC:
|
|
203
215
|
// case SchemaFieldTypes.GEO:
|
|
@@ -209,6 +221,9 @@ function pushSchema(args, schema) {
|
|
|
209
221
|
if (fieldOptions.CASESENSITIVE) {
|
|
210
222
|
args.push('CASESENSITIVE');
|
|
211
223
|
}
|
|
224
|
+
if (fieldOptions.WITHSUFFIXTRIE) {
|
|
225
|
+
args.push('WITHSUFFIXTRIE');
|
|
226
|
+
}
|
|
212
227
|
break;
|
|
213
228
|
case SchemaFieldTypes.VECTOR:
|
|
214
229
|
args.push(fieldOptions.ALGORITHM);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redis/search",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@istanbuljs/nyc-config-typescript": "^1.0.2",
|
|
20
20
|
"@redis/test-utils": "*",
|
|
21
|
-
"@types/node": "^
|
|
21
|
+
"@types/node": "^18.7.10",
|
|
22
22
|
"nyc": "^15.1.0",
|
|
23
|
-
"release-it": "^15.
|
|
23
|
+
"release-it": "^15.3.0",
|
|
24
24
|
"source-map-support": "^0.5.21",
|
|
25
|
-
"ts-node": "^10.
|
|
26
|
-
"typedoc": "^0.
|
|
27
|
-
"typescript": "^4.
|
|
25
|
+
"ts-node": "^10.9.1",
|
|
26
|
+
"typedoc": "^0.23.10",
|
|
27
|
+
"typescript": "^4.7.4"
|
|
28
28
|
}
|
|
29
29
|
}
|