Skip to content

Commit 2c41d75

Browse files
committed
7.5.0
1 parent 26c8f41 commit 2c41d75

File tree

4 files changed

+223
-2
lines changed

4 files changed

+223
-2
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,21 @@ This driver uses semantic versioning:
1414
- A change in the major version (e.g. 1.Y.Z -> 2.0.0) indicates _breaking_
1515
changes that require changes in your code to upgrade.
1616

17+
## [7.5.0] - 2021-04-22
18+
19+
### Added
20+
21+
- Added support for new ArangoDB 3.8 Analyzer types
22+
23+
This adds the `PipelineAnalyzer`, `AqlAnalyzer`, `GeoJsonAnalyzer`,
24+
`GeoPointAnalyzer` and `StopwordsAnalyzer` types in TypeScript, as well as
25+
the Analyzer-specific properties types.
26+
27+
- Added support for new ArangoDB 3.8 `estimates` option for indexes
28+
29+
This affects the `PersistentIndex`, `HashIndex` and `SkiplistIndex` types
30+
in TypeScript.
31+
1732
## [7.4.0] - 2021-04-09
1833

1934
### Added
@@ -1185,6 +1200,7 @@ For a detailed list of changes between pre-release versions of v7 see the
11851200

11861201
Graph methods now only return the relevant part of the response body.
11871202

1203+
[7.5.0]: https://github.com/arangodb/arangojs/compare/v7.4.0...v7.5.0
11881204
[7.4.0]: https://github.com/arangodb/arangojs/compare/v7.3.0...v7.4.0
11891205
[7.3.0]: https://github.com/arangodb/arangojs/compare/v7.2.0...v7.3.0
11901206
[7.2.0]: https://github.com/arangodb/arangojs/compare/v7.1.1...v7.2.0

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
33
"name": "arangojs",
4-
"version": "7.4.0",
4+
"version": "7.5.0",
55
"engines": {
66
"node": ">=10"
77
},

src/analyzer.ts

Lines changed: 185 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,12 @@ export type AnalyzerInfo =
5454
| StemAnalyzerInfo
5555
| NormAnalyzerInfo
5656
| NgramAnalyzerInfo
57-
| TextAnalyzerInfo;
57+
| TextAnalyzerInfo
58+
| PipelineAnalyzer
59+
| AqlAnalyzer
60+
| GeoJsonAnalyzer
61+
| GeoPointAnalyzer
62+
| StopwordsAnalyzer;
5863

5964
/**
6065
* Analyzer type and type-specific properties for an Identity Analyzer.
@@ -219,6 +224,10 @@ export type TextAnalyzerProperties = {
219224
* Default: `true`
220225
*/
221226
stemming?: boolean;
227+
/**
228+
* If present, then edge n-grams are generated for each token (word).
229+
*/
230+
edgeNgram?: { min?: number; max?: number; preserveOriginal?: boolean };
222231
};
223232

224233
/**
@@ -235,6 +244,181 @@ export type TextAnalyzerInfo = {
235244
properties: TextAnalyzerProperties;
236245
};
237246

247+
/**
248+
* Properties of a Pipeline Analyzer.
249+
*/
250+
export type PipelineAnalyzerProperties = {
251+
/**
252+
* Definitions for Analyzers to chain in this Pipeline Analyzer.
253+
*/
254+
pipeline: AnalyzerInfo[];
255+
};
256+
257+
/**
258+
* Analyzer type and type-specific properties for a Pipeline Analyzer
259+
*/
260+
export type PipelineAnalyzer = {
261+
/**
262+
* Type of the Analyzer.
263+
*/
264+
type: "pipeline";
265+
/**
266+
* Additional properties for the Analyzer.
267+
*/
268+
properties: PipelineAnalyzerProperties;
269+
};
270+
271+
/**
272+
* Properties of an AQL Analyzer.
273+
*/
274+
export type AqlAnalyzerProperties = {
275+
/**
276+
* AQL query to be executed.
277+
*/
278+
queryString: string;
279+
/**
280+
* If set to `true`, the position is set to `0` for all members of the query result array.
281+
*
282+
* Default: `false`
283+
*/
284+
collapsePositions?: boolean;
285+
/**
286+
* If set to `false`, `null` values will be discarded from the View index.
287+
*
288+
* Default: `true`
289+
*/
290+
keepNull?: boolean;
291+
/**
292+
* Number between `1` and `1000` that determines the batch size for reading
293+
* data from the query.
294+
*
295+
* Default: `1`
296+
*/
297+
batchSize?: number;
298+
/**
299+
* Memory limit for query execution in bytes.
300+
*
301+
* Default: `1048576` (1 MiB)
302+
*/
303+
memoryLimit?: number;
304+
/**
305+
* Data type of the returned tokens.
306+
*
307+
* Default: `"string"`
308+
*/
309+
returnType?: "string" | "number" | "bool";
310+
};
311+
312+
/**
313+
* Analyzer type and type-specific properties for an AQL Analyzer
314+
*/
315+
export type AqlAnalyzer = {
316+
/**
317+
* Type of the Analyzer.
318+
*/
319+
type: "aql";
320+
/**
321+
* Additional properties for the Analyzer.
322+
*/
323+
properties: AqlAnalyzerProperties;
324+
};
325+
326+
/**
327+
* Properties of a GeoJSON Analyzer.
328+
*/
329+
export type GeoJsonAnalyzerProperties = {
330+
/**
331+
* If set to `"centroid"`, only the centroid of the input geometry will be
332+
* computed and indexed.
333+
*
334+
* If set to `"point"` only GeoJSON objects of type Point will be indexed and
335+
* all other geometry types will be ignored.
336+
*
337+
* Default: `"shape"`
338+
*/
339+
type?: "shape" | "centroid" | "point";
340+
/**
341+
* Options for fine-tuning geo queries.
342+
*
343+
* Default: `{ maxCells: 20, minLevel: 4, maxLevel: 23 }`
344+
*/
345+
options?: { maxCells?: number; minLevel?: number; maxLevel?: number };
346+
};
347+
348+
/**
349+
* Analyzer type and type-specific properties for a GeoJSON Analyzer
350+
*/
351+
export type GeoJsonAnalyzer = {
352+
/**
353+
* Type of the Analyzer.
354+
*/
355+
type: "geojson";
356+
/**
357+
* Additional properties for the Analyzer.
358+
*/
359+
properties: GeoJsonAnalyzerProperties;
360+
};
361+
362+
/**
363+
* Properties of a GeoPoint Analyzer.
364+
*/
365+
export type GeoPointAnalyzerProperties = {
366+
/**
367+
* Attribute paths of the latitude value relative to the field for which the
368+
* Analyzer is defined in the View.
369+
*/
370+
latitude?: string[];
371+
/**
372+
* Attribute paths of the longitude value relative to the field for which the
373+
* Analyzer is defined in the View.
374+
*/
375+
longitude?: string[];
376+
/**
377+
* Options for fine-tuning geo queries.
378+
*
379+
* Default: `{ maxCells: 20, minLevel: 4, maxLevel: 23 }`
380+
*/
381+
options?: { minCells?: number; minLevel?: number; maxLevel?: number };
382+
};
383+
384+
/**
385+
* Analyzer type and type-specific properties for a GeoPoint Analyzer
386+
*/
387+
export type GeoPointAnalyzer = {
388+
/**
389+
* Type of the Analyzer.
390+
*/
391+
type: "geopoint";
392+
/**
393+
* Additional properties for the Analyzer.
394+
*/
395+
properties: GeoPointAnalyzerProperties;
396+
};
397+
398+
/**
399+
* Properties of a Stopwords Analyzer.
400+
*/
401+
export type StopwordsAnalyzerProperties = {
402+
/**
403+
* Hex-encoded strings that describe the tokens to be discarded.
404+
*/
405+
stopwords: string[];
406+
};
407+
408+
/**
409+
* Analyzer type and type-specific properties for a Stopwords Analyzer
410+
*/
411+
export type StopwordsAnalyzer = {
412+
/**
413+
* Type of the Analyzer.
414+
*/
415+
type: "stopwords";
416+
/**
417+
* Additional properties for the Analyzer.
418+
*/
419+
properties: StopwordsAnalyzerProperties;
420+
};
421+
238422
/**
239423
* Represents an Analyzer in a {@link Database}.
240424
*/

src/indexes.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,13 @@ export type EnsureHashIndexOptions = {
5555
* Default: `true`
5656
*/
5757
deduplicate?: boolean;
58+
/**
59+
* If set to `false`, index selectivity estimates will be disabled for this
60+
* index.
61+
*
62+
* Default: `true`
63+
*/
64+
estimates?: boolean;
5865
};
5966

6067
/**
@@ -96,6 +103,13 @@ export type EnsureSkiplistIndexOptions = {
96103
* Default: `true`
97104
*/
98105
deduplicate?: boolean;
106+
/**
107+
* If set to `false`, index selectivity estimates will be disabled for this
108+
* index.
109+
*
110+
* Default: `true`
111+
*/
112+
estimates?: boolean;
99113
};
100114

101115
/**
@@ -128,6 +142,13 @@ export type EnsurePersistentIndexOptions = {
128142
* Default: `false`
129143
*/
130144
sparse?: boolean;
145+
/**
146+
* If set to `false`, index selectivity estimates will be disabled for this
147+
* index.
148+
*
149+
* Default: `true`
150+
*/
151+
estimates?: boolean;
131152
};
132153

133154
/**

0 commit comments

Comments
 (0)