@redis/search 1.1.3 → 1.1.4

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/README.md CHANGED
@@ -12,7 +12,7 @@ For complete examples, see [`search-hashes.js`](https://github.com/redis/node-re
12
12
 
13
13
  #### Creating an Index
14
14
 
15
- Before we can perform any searches, we need to tell RediSearch how to index our data, and which Redis keys to find that data in. The [FT.CREATE](https://oss.redis.com/redisearch/Commands/#ftcreate) command creates a RediSearch index. Here's how to use it to create an index we'll call `idx:animals` where we want to index hashes containing `name`, `species` and `age` fields, and whose key names in Redis begin with the prefix `noderedis:animals`:
15
+ Before we can perform any searches, we need to tell RediSearch how to index our data, and which Redis keys to find that data in. The [FT.CREATE](https://redis.io/commands/ft.create) command creates a RediSearch index. Here's how to use it to create an index we'll call `idx:animals` where we want to index hashes containing `name`, `species` and `age` fields, and whose key names in Redis begin with the prefix `noderedis:animals`:
16
16
 
17
17
  ```javascript
18
18
  await client.ft.create('idx:animals', {
@@ -28,11 +28,11 @@ await client.ft.create('idx:animals', {
28
28
  });
29
29
  ```
30
30
 
31
- See the [`FT.CREATE` documentation](https://oss.redis.com/redisearch/Commands/#ftcreate) for information about the different field types and additional options.
31
+ See the [`FT.CREATE` documentation](https://redis.io/commands/ft.create/#description) for information about the different field types and additional options.
32
32
 
33
33
  #### Querying the Index
34
34
 
35
- Once we've created an index, and added some data to Redis hashes whose keys begin with the prefix `noderedis:animals`, we can start writing some search queries. RediSearch supports a rich query syntax for full-text search, faceted search, aggregation and more. Check out the [`FT.SEARCH` documentation](https://oss.redis.com/redisearch/Commands/#ftsearch) and the [query syntax reference](https://oss.redis.com/redisearch/Query_Syntax/) for more information.
35
+ Once we've created an index, and added some data to Redis hashes whose keys begin with the prefix `noderedis:animals`, we can start writing some search queries. RediSearch supports a rich query syntax for full-text search, faceted search, aggregation and more. Check out the [`FT.SEARCH` documentation](https://redis.io/commands/ft.search) and the [query syntax reference](https://redis.io/docs/interact/search-and-query/query) for more information.
36
36
 
37
37
  Let's write a query to find all the animals where the `species` field has the value `dog`:
38
38
 
@@ -112,7 +112,7 @@ Note that we're using JSON Path to specify where the fields to index are in our
112
112
 
113
113
  Now we have an index and some data stored as JSON documents in Redis (see the [JSON package documentation](https://github.com/redis/node-redis/tree/master/packages/json) for examples of how to store JSON), we can write some queries...
114
114
 
115
- We'll use the [RediSearch query language](https://oss.redis.com/redisearch/Query_Syntax/) and [`FT.SEARCH`](https://oss.redis.com/redisearch/Commands/#ftsearch) command. Here's a query to find users under the age of 30:
115
+ We'll use the [RediSearch query language](https://redis.io/docs/interact/search-and-query/query) and [`FT.SEARCH`](https://redis.io/commands/ft.search) command. Here's a query to find users under the age of 30:
116
116
 
117
117
  ```javascript
118
118
  await client.ft.search('idx:users', '@age:[0 30]');
@@ -10,7 +10,7 @@ var AggregateSteps;
10
10
  AggregateSteps["APPLY"] = "APPLY";
11
11
  AggregateSteps["LIMIT"] = "LIMIT";
12
12
  AggregateSteps["FILTER"] = "FILTER";
13
- })(AggregateSteps = exports.AggregateSteps || (exports.AggregateSteps = {}));
13
+ })(AggregateSteps || (exports.AggregateSteps = AggregateSteps = {}));
14
14
  var AggregateGroupByReducers;
15
15
  (function (AggregateGroupByReducers) {
16
16
  AggregateGroupByReducers["COUNT"] = "COUNT";
@@ -26,7 +26,7 @@ var AggregateGroupByReducers;
26
26
  AggregateGroupByReducers["TO_LIST"] = "TOLIST";
27
27
  AggregateGroupByReducers["FIRST_VALUE"] = "FIRST_VALUE";
28
28
  AggregateGroupByReducers["RANDOM_SAMPLE"] = "RANDOM_SAMPLE";
29
- })(AggregateGroupByReducers = exports.AggregateGroupByReducers || (exports.AggregateGroupByReducers = {}));
29
+ })(AggregateGroupByReducers || (exports.AggregateGroupByReducers = AggregateGroupByReducers = {}));
30
30
  exports.FIRST_KEY_INDEX = 1;
31
31
  exports.IS_READ_ONLY = true;
32
32
  function transformArguments(index, query, options) {
@@ -0,0 +1,10 @@
1
+ import { RedisCommandArguments } from "@redis/client/dist/lib/commands";
2
+ import { SearchOptions, SearchRawReply } from "./SEARCH";
3
+ export declare const FIRST_KEY_INDEX = 1;
4
+ export declare const IS_READ_ONLY = true;
5
+ export declare function transformArguments(index: string, query: string, options?: SearchOptions): RedisCommandArguments;
6
+ export interface SearchNoContentReply {
7
+ total: number;
8
+ documents: Array<string>;
9
+ }
10
+ export declare function transformReply(reply: SearchRawReply): SearchNoContentReply;
@@ -0,0 +1,18 @@
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 _1 = require(".");
5
+ exports.FIRST_KEY_INDEX = 1;
6
+ exports.IS_READ_ONLY = true;
7
+ function transformArguments(index, query, options) {
8
+ return (0, _1.pushSearchOptions)(['FT.SEARCH', index, query, 'NOCONTENT'], options);
9
+ }
10
+ exports.transformArguments = transformArguments;
11
+ ;
12
+ function transformReply(reply) {
13
+ return {
14
+ total: reply[0],
15
+ documents: reply.slice(1)
16
+ };
17
+ }
18
+ exports.transformReply = transformReply;
@@ -20,6 +20,7 @@ import * as INFO from './INFO';
20
20
  import * as PROFILESEARCH from './PROFILE_SEARCH';
21
21
  import * as PROFILEAGGREGATE from './PROFILE_AGGREGATE';
22
22
  import * as SEARCH from './SEARCH';
23
+ import * as SEARCH_NOCONTENT from './SEARCH_NOCONTENT';
23
24
  import * as SPELLCHECK from './SPELLCHECK';
24
25
  import * as SUGADD from './SUGADD';
25
26
  import * as SUGDEL from './SUGDEL';
@@ -78,6 +79,8 @@ declare const _default: {
78
79
  profileAggregate: typeof PROFILEAGGREGATE;
79
80
  SEARCH: typeof SEARCH;
80
81
  search: typeof SEARCH;
82
+ SEARCH_NOCONTENT: typeof SEARCH_NOCONTENT;
83
+ searchNoContent: typeof SEARCH_NOCONTENT;
81
84
  SPELLCHECK: typeof SPELLCHECK;
82
85
  spellCheck: typeof SPELLCHECK;
83
86
  SUGADD: typeof SUGADD;
@@ -23,6 +23,7 @@ const INFO = require("./INFO");
23
23
  const PROFILESEARCH = require("./PROFILE_SEARCH");
24
24
  const PROFILEAGGREGATE = require("./PROFILE_AGGREGATE");
25
25
  const SEARCH = require("./SEARCH");
26
+ const SEARCH_NOCONTENT = require("./SEARCH_NOCONTENT");
26
27
  const SPELLCHECK = require("./SPELLCHECK");
27
28
  const SUGADD = require("./SUGADD");
28
29
  const SUGDEL = require("./SUGDEL");
@@ -80,6 +81,8 @@ exports.default = {
80
81
  profileAggregate: PROFILEAGGREGATE,
81
82
  SEARCH,
82
83
  search: SEARCH,
84
+ SEARCH_NOCONTENT,
85
+ searchNoContent: SEARCH_NOCONTENT,
83
86
  SPELLCHECK,
84
87
  spellCheck: SPELLCHECK,
85
88
  SUGADD,
@@ -130,7 +133,7 @@ var RedisSearchLanguages;
130
133
  RedisSearchLanguages["TAMIL"] = "Tamil";
131
134
  RedisSearchLanguages["TURKISH"] = "Turkish";
132
135
  RedisSearchLanguages["CHINESE"] = "Chinese";
133
- })(RedisSearchLanguages = exports.RedisSearchLanguages || (exports.RedisSearchLanguages = {}));
136
+ })(RedisSearchLanguages || (exports.RedisSearchLanguages = RedisSearchLanguages = {}));
134
137
  function pushSortByProperty(args, sortBy) {
135
138
  if (typeof sortBy === 'string') {
136
139
  args.push(sortBy);
@@ -172,19 +175,19 @@ var SchemaFieldTypes;
172
175
  SchemaFieldTypes["GEO"] = "GEO";
173
176
  SchemaFieldTypes["TAG"] = "TAG";
174
177
  SchemaFieldTypes["VECTOR"] = "VECTOR";
175
- })(SchemaFieldTypes = exports.SchemaFieldTypes || (exports.SchemaFieldTypes = {}));
178
+ })(SchemaFieldTypes || (exports.SchemaFieldTypes = SchemaFieldTypes = {}));
176
179
  var SchemaTextFieldPhonetics;
177
180
  (function (SchemaTextFieldPhonetics) {
178
181
  SchemaTextFieldPhonetics["DM_EN"] = "dm:en";
179
182
  SchemaTextFieldPhonetics["DM_FR"] = "dm:fr";
180
183
  SchemaTextFieldPhonetics["FM_PT"] = "dm:pt";
181
184
  SchemaTextFieldPhonetics["DM_ES"] = "dm:es";
182
- })(SchemaTextFieldPhonetics = exports.SchemaTextFieldPhonetics || (exports.SchemaTextFieldPhonetics = {}));
185
+ })(SchemaTextFieldPhonetics || (exports.SchemaTextFieldPhonetics = SchemaTextFieldPhonetics = {}));
183
186
  var VectorAlgorithms;
184
187
  (function (VectorAlgorithms) {
185
188
  VectorAlgorithms["FLAT"] = "FLAT";
186
189
  VectorAlgorithms["HNSW"] = "HNSW";
187
- })(VectorAlgorithms = exports.VectorAlgorithms || (exports.VectorAlgorithms = {}));
190
+ })(VectorAlgorithms || (exports.VectorAlgorithms = VectorAlgorithms = {}));
188
191
  function pushSchema(args, schema) {
189
192
  for (const [field, fieldOptions] of Object.entries(schema)) {
190
193
  args.push(field);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redis/search",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "license": "MIT",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -18,13 +18,13 @@
18
18
  "devDependencies": {
19
19
  "@istanbuljs/nyc-config-typescript": "^1.0.2",
20
20
  "@redis/test-utils": "*",
21
- "@types/node": "^20.2.3",
21
+ "@types/node": "^20.6.2",
22
22
  "nyc": "^15.1.0",
23
- "release-it": "^15.10.3",
23
+ "release-it": "^16.1.5",
24
24
  "source-map-support": "^0.5.21",
25
25
  "ts-node": "^10.9.1",
26
- "typedoc": "^0.24.7",
27
- "typescript": "^5.0.4"
26
+ "typedoc": "^0.25.1",
27
+ "typescript": "^5.2.2"
28
28
  },
29
29
  "repository": {
30
30
  "type": "git",