@indxsearch/indx-types 3.0.0 → 4.0.0-beta.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/CHANGELOG.md +54 -0
- package/README.md +14 -21
- package/dist/boost.d.ts +6 -1
- package/dist/enums.d.ts +46 -12
- package/dist/enums.js +55 -14
- package/dist/errors.d.ts +8 -7
- package/dist/errors.js +8 -7
- package/dist/fields.d.ts +21 -5
- package/dist/filters.d.ts +47 -2
- package/dist/index.d.ts +6 -5
- package/dist/index.js +1 -1
- package/dist/problem.d.ts +10 -3
- package/dist/query.d.ts +73 -22
- package/dist/result.d.ts +75 -2
- package/dist/rules.d.ts +83 -0
- package/dist/status.d.ts +14 -2
- package/package.json +1 -1
- package/dist/access.d.ts +0 -19
- /package/dist/{access.js → rules.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,59 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 4.0.0-beta.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- 0b3925e: `filters/combine` takes a list. `CombinedFilterProxy` is `{ filters: FilterProxy[], useAndOperation }`
|
|
8
|
+
in place of `{ a, b, useAndOperation }`, and the server makes one filter of the whole list. The
|
|
9
|
+
intrface sends one combine per field and one for the whole selection, where it sent one per pair:
|
|
10
|
+
three values on one field were two requests and are one. Needs a server with the list form.
|
|
11
|
+
- a394c82: The 6.0 wire: a query in three parts. `QueryProxy` takes `mode` (`SearchMode`: `EditDistance`,
|
|
12
|
+
the default, or `Bm25f`; whether the records are reranked by Coverage is `ranking.rerank`, on by
|
|
13
|
+
default) and three parts, `match` (`MatchSetup`: tolerance, rungs, the word being
|
|
14
|
+
typed), `candidates` (`CandidateSetup`: `candidatesPerRow`, `maxCandidates`, `fallback`, `rest`) and
|
|
15
|
+
`ranking` (`RankingProxy`: the blend, field weights and boosts, `boosts` and `buries`).
|
|
16
|
+
`enableCoverage`, `coverageDepth`, `coverageSetup` and the `CoverageSetup` and `CloudQuery` types are
|
|
17
|
+
gone. Enums are strings, by name, as the server now sends and reads them (`BoostStrength.Med`, was
|
|
18
|
+
`Medium`). `Result` loses `truncationIndex` and `truncationScore` and has `toleranceCounts`,
|
|
19
|
+
`countedTolerance`, `count`, `ranked`, `isFallback`, `reason` and `systemState` (`toleranceCounts.rest`
|
|
20
|
+
with `candidates.rest`). The provider's `countedTotal` is the result's `count`. `FieldProxy` follows the
|
|
21
|
+
server's: `wordMatching` in place of `searchable`, and `tolerance` (`Exact`, `OneEdit`,
|
|
22
|
+
`TwoEdits`) in place of `coverageStrictness`, whose `None` is a `rerankWeight` of 0; the
|
|
23
|
+
`CoverageStrictness` enum is gone. Coverage is called reranking: `enableMatchReport`,
|
|
24
|
+
`matchReport` (`MatchReport`) and a field's `rerankWeight` in place of `enableCoverageReport`,
|
|
25
|
+
`coverageReport` and `coverageWeight`.
|
|
26
|
+
|
|
27
|
+
The settings panel shows the mode and a rerank switch. The intrface provider takes `mode`, `match`, `candidates` and `ranking` in place of
|
|
28
|
+
`enableCoverage`, `coverageDepth` (now `candidates.maxCandidates`) and `initialCoverageSetup`;
|
|
29
|
+
`SearchSettings` holds the same, and `setSearchSettings` merges a part member by member. The state's
|
|
30
|
+
`truncationIndex` is `countedTotal`, the records the search counted, with `isFallback` beside it.
|
|
31
|
+
Needs a 6.0 server.
|
|
32
|
+
|
|
33
|
+
- 496a2dc: The rest of the 6.0 server's requests and answers: `InFilterProxy`, `PositionFilterProxy`,
|
|
34
|
+
`FilterExpressionProxy` with `FilterExpressionResultProxy` and `FilterExpressionErrorDetail`, the
|
|
35
|
+
saved `BoostRule` and `BuryRule` (`RuleCondition`), a dataset's `DatasetQueryParameters` and
|
|
36
|
+
`QueryParametersResponse`, and field profiles (`FieldProfile`, `FieldProfileView`,
|
|
37
|
+
`FieldProfilesResponse`, `FieldProfilesRequest`). `FieldProxy.typingPrefixFrom` and
|
|
38
|
+
`ValueFilterProxy.isCaseSensitive` are added; `SystemStatus` has `indexedTextTruncated`,
|
|
39
|
+
`wordTokenSizeCapped` and `fieldK1Ignored`, and loses `tooLongClientText` and
|
|
40
|
+
`unknownConfigurationError`, which the server no longer sends. `IndxProblemCode` names every code
|
|
41
|
+
the server answers with, `invalidFilterExpression` among them, and `IndxProblem.errors` carries an
|
|
42
|
+
expression's errors. `PageFill`, `MatchReport`, `RecordMatch`, `QueryWordMatch` and `WordMatch` are
|
|
43
|
+
exported. Every type is checked against the server's OpenAPI document.
|
|
44
|
+
|
|
45
|
+
### Minor Changes
|
|
46
|
+
|
|
47
|
+
- 9085f78: `QueryProxy.measureFit` and `QueryFitResult`: a search can also say how well its results explain the
|
|
48
|
+
text (`explainedShare`, `unexplainedShare`, `explainedWords`, `unexplainedWords`), for telling a
|
|
49
|
+
search from a question.
|
|
50
|
+
|
|
51
|
+
## 3.1.0
|
|
52
|
+
|
|
53
|
+
### Minor Changes
|
|
54
|
+
|
|
55
|
+
- `SystemStatus` describes a rebuild's outcome: `shadowBuildFinishedUtc` says when the last rebuild ended, and `shadowBuildError` why it failed, if it did. A failed rebuild changes nothing: the dataset keeps serving what it had.
|
|
56
|
+
|
|
3
57
|
All notable changes to this project will be documented in this file.
|
|
4
58
|
|
|
5
59
|
## 3.0.0
|
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ npm install @indxsearch/indx-types
|
|
|
18
18
|
|
|
19
19
|
## Version Compatibility
|
|
20
20
|
|
|
21
|
-
This package (`@indxsearch/indx-types`
|
|
21
|
+
This package (`@indxsearch/indx-types` 3.x) provides types for **Indx v2.0** (IndxSearchLib v5). The shapes are generated from and verified against the live v5 OpenAPI spec.
|
|
22
22
|
|
|
23
23
|
## Usage
|
|
24
24
|
|
|
@@ -60,8 +60,7 @@ const valueFilter: ValueFilterProxy = {
|
|
|
60
60
|
|
|
61
61
|
// Combined filter
|
|
62
62
|
const combinedFilter: CombinedFilterProxy = {
|
|
63
|
-
|
|
64
|
-
b: valueFilter,
|
|
63
|
+
filters: [rangeFilter, valueFilter],
|
|
65
64
|
useAndOperation: true
|
|
66
65
|
};
|
|
67
66
|
```
|
|
@@ -80,30 +79,22 @@ const boost: BoostProxy = {
|
|
|
80
79
|
|
|
81
80
|
const query: QueryProxy = {
|
|
82
81
|
text: 'search term',
|
|
83
|
-
|
|
84
|
-
boosts: [boost]
|
|
82
|
+
ranking: { boosts: [boost] }
|
|
85
83
|
};
|
|
86
84
|
```
|
|
87
85
|
|
|
88
|
-
###
|
|
86
|
+
### Match, Candidates and Ranking
|
|
89
87
|
|
|
90
88
|
```typescript
|
|
91
|
-
import
|
|
92
|
-
|
|
93
|
-
const coverageSetup: CoverageSetup = {
|
|
94
|
-
coverWholeQuery: true,
|
|
95
|
-
coverWholeWords: true,
|
|
96
|
-
coverFuzzyWords: true,
|
|
97
|
-
minWordSize: 2,
|
|
98
|
-
levenshteinMaxWordSize: 20,
|
|
99
|
-
truncate: true,
|
|
100
|
-
truncationScore: 255
|
|
101
|
-
};
|
|
89
|
+
import { SearchMode, Tolerance } from '@indxsearch/indx-types';
|
|
90
|
+
import type { QueryProxy } from '@indxsearch/indx-types';
|
|
102
91
|
|
|
103
92
|
const query: QueryProxy = {
|
|
104
93
|
text: 'search term',
|
|
105
|
-
|
|
106
|
-
|
|
94
|
+
mode: SearchMode.Coverage,
|
|
95
|
+
match: { tolerance: Tolerance.OneEdit }, // what counts as a hit
|
|
96
|
+
candidates: { maxCandidates: 200 }, // who comes in
|
|
97
|
+
ranking: { share: 0.2 } // the order
|
|
107
98
|
};
|
|
108
99
|
```
|
|
109
100
|
|
|
@@ -125,8 +116,10 @@ if (status.systemState === SystemState.Ready) {
|
|
|
125
116
|
### Types
|
|
126
117
|
|
|
127
118
|
#### Query Types
|
|
128
|
-
- `QueryProxy` - Main search query interface
|
|
129
|
-
- `
|
|
119
|
+
- `QueryProxy` - Main search query interface: `mode` and the parts below
|
|
120
|
+
- `MatchSetup` - What counts as a hit: tolerance, rungs, the word being typed
|
|
121
|
+
- `CandidateSetup` - Who comes in: candidates per row, the bound, the fallback
|
|
122
|
+
- `RankingProxy` - The order: the blend, field weights and boosts, boosts and buries
|
|
130
123
|
|
|
131
124
|
#### Filter Types
|
|
132
125
|
- `FilterProxy` - Base filter interface
|
package/dist/boost.d.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import { BoostStrength } from './enums';
|
|
1
|
+
import { BoostStrength, BuryStrength } from './enums';
|
|
2
2
|
import { FilterProxy } from './filters';
|
|
3
3
|
export interface BoostProxy {
|
|
4
4
|
boostStrength: BoostStrength;
|
|
5
5
|
filterProxy: FilterProxy;
|
|
6
6
|
}
|
|
7
|
+
/** A bury, the counterpart of a boost: from `buries/from-filter`, sent in `ranking.buries`. */
|
|
8
|
+
export interface BuryProxy {
|
|
9
|
+
buryStrength: BuryStrength;
|
|
10
|
+
filterProxy: FilterProxy;
|
|
11
|
+
}
|
package/dist/enums.d.ts
CHANGED
|
@@ -1,22 +1,56 @@
|
|
|
1
1
|
export declare enum SystemState {
|
|
2
|
-
Created =
|
|
3
|
-
Loading =
|
|
4
|
-
Loaded =
|
|
5
|
-
Indexing =
|
|
6
|
-
Ready =
|
|
7
|
-
Error =
|
|
2
|
+
Created = "Created",
|
|
3
|
+
Loading = "Loading",
|
|
4
|
+
Loaded = "Loaded",
|
|
5
|
+
Indexing = "Indexing",
|
|
6
|
+
Ready = "Ready",
|
|
7
|
+
Error = "Error"
|
|
8
8
|
}
|
|
9
9
|
export declare enum BoostStrength {
|
|
10
|
-
Low =
|
|
11
|
-
|
|
12
|
-
High =
|
|
10
|
+
Low = "Low",
|
|
11
|
+
Med = "Med",
|
|
12
|
+
High = "High"
|
|
13
|
+
}
|
|
14
|
+
/** The counterpart of {@link BoostStrength}: how far a bury lowers the documents its filter holds. */
|
|
15
|
+
export declare enum BuryStrength {
|
|
16
|
+
Low = "Low",
|
|
17
|
+
Med = "Med",
|
|
18
|
+
High = "High"
|
|
13
19
|
}
|
|
14
20
|
/**
|
|
15
21
|
* How a SynonymEntry expands. Multidirectional: every term in the entry triggers the whole
|
|
16
22
|
* group. OneWay: only `source` expands, into `terms` (acronyms).
|
|
17
|
-
* Numeric on the wire, like every enum in this API.
|
|
18
23
|
*/
|
|
19
24
|
export declare enum SynonymDirection {
|
|
20
|
-
Multidirectional =
|
|
21
|
-
OneWay =
|
|
25
|
+
Multidirectional = "Multidirectional",
|
|
26
|
+
OneWay = "OneWay"
|
|
27
|
+
}
|
|
28
|
+
/** How a search finds and orders its documents (QueryProxy.mode). */
|
|
29
|
+
/** How a search fetches its records (QueryProxy.mode); whether they are reranked is
|
|
30
|
+
* `ranking.rerank`. Until 2 Nov 2026 a third value, Coverage, was EditDistance reranked. */
|
|
31
|
+
export declare enum SearchMode {
|
|
32
|
+
/** BM25F: no word lookup, no count. Reranked, its best up to the bound are reranked. */
|
|
33
|
+
Bm25f = "Bm25f",
|
|
34
|
+
/** The records holding every query word within the tolerance, ordered by rung. The default. */
|
|
35
|
+
EditDistance = "EditDistance"
|
|
36
|
+
}
|
|
37
|
+
/** The rungs a query word is met on: as typed, within one edit, within two, within three. */
|
|
38
|
+
export declare enum Tolerance {
|
|
39
|
+
Exact = "Exact",
|
|
40
|
+
OneEdit = "OneEdit",
|
|
41
|
+
TwoEdits = "TwoEdits",
|
|
42
|
+
ThreeEdits = "ThreeEdits"
|
|
43
|
+
}
|
|
44
|
+
/** Which rungs a search counts (MatchSetup.rungs). */
|
|
45
|
+
export declare enum Rungs {
|
|
46
|
+
/** The first rung that gives hits. The default. */
|
|
47
|
+
Fewest = "Fewest",
|
|
48
|
+
/** Every rung up to the tolerance, the nearer ranked first. */
|
|
49
|
+
All = "All"
|
|
50
|
+
}
|
|
51
|
+
/** Which of the index's terms BM25F scores with (CandidateSetup.indexTerms). */
|
|
52
|
+
export declare enum IndexTerms {
|
|
53
|
+
Both = "Both",
|
|
54
|
+
Words = "Words",
|
|
55
|
+
Patterns = "Patterns"
|
|
22
56
|
}
|
package/dist/enums.js
CHANGED
|
@@ -1,28 +1,69 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
1
|
+
// Every enum is written by name on the wire since 6.0 (the server's JsonStringEnumConverter); a
|
|
2
|
+
// number in a request is still read, but these types say the names.
|
|
3
|
+
// Hibernated was removed Sep 2026 together with the server's: hibernation is a position in the
|
|
4
|
+
// pipeline, not a state. A hibernated dataset reports Created with recordsOnDisk > 0 in its
|
|
3
5
|
// status; the library's Hibernate() lands in Loaded.
|
|
4
6
|
export var SystemState;
|
|
5
7
|
(function (SystemState) {
|
|
6
|
-
SystemState[
|
|
7
|
-
SystemState[
|
|
8
|
-
SystemState[
|
|
9
|
-
SystemState[
|
|
10
|
-
SystemState[
|
|
11
|
-
SystemState[
|
|
8
|
+
SystemState["Created"] = "Created";
|
|
9
|
+
SystemState["Loading"] = "Loading";
|
|
10
|
+
SystemState["Loaded"] = "Loaded";
|
|
11
|
+
SystemState["Indexing"] = "Indexing";
|
|
12
|
+
SystemState["Ready"] = "Ready";
|
|
13
|
+
SystemState["Error"] = "Error";
|
|
12
14
|
})(SystemState || (SystemState = {}));
|
|
13
15
|
export var BoostStrength;
|
|
14
16
|
(function (BoostStrength) {
|
|
15
|
-
BoostStrength[
|
|
16
|
-
BoostStrength[
|
|
17
|
-
BoostStrength[
|
|
17
|
+
BoostStrength["Low"] = "Low";
|
|
18
|
+
BoostStrength["Med"] = "Med";
|
|
19
|
+
BoostStrength["High"] = "High";
|
|
18
20
|
})(BoostStrength || (BoostStrength = {}));
|
|
21
|
+
/** The counterpart of {@link BoostStrength}: how far a bury lowers the documents its filter holds. */
|
|
22
|
+
export var BuryStrength;
|
|
23
|
+
(function (BuryStrength) {
|
|
24
|
+
BuryStrength["Low"] = "Low";
|
|
25
|
+
BuryStrength["Med"] = "Med";
|
|
26
|
+
BuryStrength["High"] = "High";
|
|
27
|
+
})(BuryStrength || (BuryStrength = {}));
|
|
19
28
|
/**
|
|
20
29
|
* How a SynonymEntry expands. Multidirectional: every term in the entry triggers the whole
|
|
21
30
|
* group. OneWay: only `source` expands, into `terms` (acronyms).
|
|
22
|
-
* Numeric on the wire, like every enum in this API.
|
|
23
31
|
*/
|
|
24
32
|
export var SynonymDirection;
|
|
25
33
|
(function (SynonymDirection) {
|
|
26
|
-
SynonymDirection[
|
|
27
|
-
SynonymDirection[
|
|
34
|
+
SynonymDirection["Multidirectional"] = "Multidirectional";
|
|
35
|
+
SynonymDirection["OneWay"] = "OneWay";
|
|
28
36
|
})(SynonymDirection || (SynonymDirection = {}));
|
|
37
|
+
/** How a search finds and orders its documents (QueryProxy.mode). */
|
|
38
|
+
/** How a search fetches its records (QueryProxy.mode); whether they are reranked is
|
|
39
|
+
* `ranking.rerank`. Until 2 Nov 2026 a third value, Coverage, was EditDistance reranked. */
|
|
40
|
+
export var SearchMode;
|
|
41
|
+
(function (SearchMode) {
|
|
42
|
+
/** BM25F: no word lookup, no count. Reranked, its best up to the bound are reranked. */
|
|
43
|
+
SearchMode["Bm25f"] = "Bm25f";
|
|
44
|
+
/** The records holding every query word within the tolerance, ordered by rung. The default. */
|
|
45
|
+
SearchMode["EditDistance"] = "EditDistance";
|
|
46
|
+
})(SearchMode || (SearchMode = {}));
|
|
47
|
+
/** The rungs a query word is met on: as typed, within one edit, within two, within three. */
|
|
48
|
+
export var Tolerance;
|
|
49
|
+
(function (Tolerance) {
|
|
50
|
+
Tolerance["Exact"] = "Exact";
|
|
51
|
+
Tolerance["OneEdit"] = "OneEdit";
|
|
52
|
+
Tolerance["TwoEdits"] = "TwoEdits";
|
|
53
|
+
Tolerance["ThreeEdits"] = "ThreeEdits";
|
|
54
|
+
})(Tolerance || (Tolerance = {}));
|
|
55
|
+
/** Which rungs a search counts (MatchSetup.rungs). */
|
|
56
|
+
export var Rungs;
|
|
57
|
+
(function (Rungs) {
|
|
58
|
+
/** The first rung that gives hits. The default. */
|
|
59
|
+
Rungs["Fewest"] = "Fewest";
|
|
60
|
+
/** Every rung up to the tolerance, the nearer ranked first. */
|
|
61
|
+
Rungs["All"] = "All";
|
|
62
|
+
})(Rungs || (Rungs = {}));
|
|
63
|
+
/** Which of the index's terms BM25F scores with (CandidateSetup.indexTerms). */
|
|
64
|
+
export var IndexTerms;
|
|
65
|
+
(function (IndexTerms) {
|
|
66
|
+
IndexTerms["Both"] = "Both";
|
|
67
|
+
IndexTerms["Words"] = "Words";
|
|
68
|
+
IndexTerms["Patterns"] = "Patterns";
|
|
69
|
+
})(IndexTerms || (IndexTerms = {}));
|
package/dist/errors.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
/** By name on the wire since 6.0. */
|
|
1
2
|
export declare enum JsonErrorType {
|
|
2
|
-
None =
|
|
3
|
-
ControlCharacters =
|
|
4
|
-
TrailingComma =
|
|
5
|
-
UnescapedQuotes =
|
|
6
|
-
UnescapedBackslash =
|
|
7
|
-
StructuralError =
|
|
8
|
-
UnknownError =
|
|
3
|
+
None = "None",
|
|
4
|
+
ControlCharacters = "ControlCharacters",
|
|
5
|
+
TrailingComma = "TrailingComma",
|
|
6
|
+
UnescapedQuotes = "UnescapedQuotes",
|
|
7
|
+
UnescapedBackslash = "UnescapedBackslash",
|
|
8
|
+
StructuralError = "StructuralError",
|
|
9
|
+
UnknownError = "UnknownError"
|
|
9
10
|
}
|
|
10
11
|
export interface ParseResult {
|
|
11
12
|
token?: string | null;
|
package/dist/errors.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
/** By name on the wire since 6.0. */
|
|
1
2
|
export var JsonErrorType;
|
|
2
3
|
(function (JsonErrorType) {
|
|
3
|
-
JsonErrorType[
|
|
4
|
-
JsonErrorType[
|
|
5
|
-
JsonErrorType[
|
|
6
|
-
JsonErrorType[
|
|
7
|
-
JsonErrorType[
|
|
8
|
-
JsonErrorType[
|
|
9
|
-
JsonErrorType[
|
|
4
|
+
JsonErrorType["None"] = "None";
|
|
5
|
+
JsonErrorType["ControlCharacters"] = "ControlCharacters";
|
|
6
|
+
JsonErrorType["TrailingComma"] = "TrailingComma";
|
|
7
|
+
JsonErrorType["UnescapedQuotes"] = "UnescapedQuotes";
|
|
8
|
+
JsonErrorType["UnescapedBackslash"] = "UnescapedBackslash";
|
|
9
|
+
JsonErrorType["StructuralError"] = "StructuralError";
|
|
10
|
+
JsonErrorType["UnknownError"] = "UnknownError";
|
|
10
11
|
})(JsonErrorType || (JsonErrorType = {}));
|
package/dist/fields.d.ts
CHANGED
|
@@ -1,14 +1,25 @@
|
|
|
1
|
+
import { Tolerance } from './enums';
|
|
1
2
|
export interface FieldProxy {
|
|
2
3
|
fieldName: string;
|
|
3
4
|
/** Read-only on GET; ignored on SET. */
|
|
4
5
|
fieldType?: string | null;
|
|
5
6
|
/** Read-only on GET; ignored on SET. */
|
|
6
7
|
isArray?: boolean | null;
|
|
7
|
-
|
|
8
|
+
/** Read-only on GET: some records lack the field. */
|
|
9
|
+
optional?: boolean | null;
|
|
10
|
+
/** Read-only on GET: a value of the field from the analysed records. */
|
|
11
|
+
sampleValue?: string | null;
|
|
12
|
+
/** Searched by its words, and in the word lookup. A field with neither this nor patternMatching is not searched. */
|
|
13
|
+
wordMatching?: boolean | null;
|
|
8
14
|
filterable?: boolean | null;
|
|
9
15
|
facetable?: boolean | null;
|
|
10
16
|
sortable?: boolean | null;
|
|
11
|
-
|
|
17
|
+
/** Matched inside its words (true) or by whole words only (false, the default). */
|
|
18
|
+
patternMatching?: boolean | null;
|
|
19
|
+
/** With pattern matching on: the index sizes, e.g. [3] or [2, 3]. */
|
|
20
|
+
indexSizes?: number[] | null;
|
|
21
|
+
numberOfStartCharacters?: number | null;
|
|
22
|
+
numberOfStopCharacters?: number | null;
|
|
12
23
|
embeddable?: boolean | null;
|
|
13
24
|
preloadFilters?: boolean | null;
|
|
14
25
|
/** Score weight multiplier (typical 1.0–3.0). Only meaningful when searchable. */
|
|
@@ -17,7 +28,12 @@ export interface FieldProxy {
|
|
|
17
28
|
bM25b?: number | null;
|
|
18
29
|
/** Per-field term-frequency saturation parameter k1. Typical 1.0–2.0. */
|
|
19
30
|
bM25k1?: number | null;
|
|
20
|
-
/**
|
|
21
|
-
|
|
22
|
-
|
|
31
|
+
/** The most a word may differ by in the field: Exact, OneEdit (the default), TwoEdits, ThreeEdits; a search's match.tolerance caps it. Until 6.0 coverageStrictness. */
|
|
32
|
+
tolerance?: Tolerance | null;
|
|
33
|
+
/** The field's weight in Coverage against the heaviest field; 0 leaves it out of Coverage (until 6.0 coverageStrictness None). */
|
|
34
|
+
rerankWeight?: number | null;
|
|
35
|
+
caseSensitive?: boolean | null;
|
|
36
|
+
/** From how many letters the word being typed matches the start of a longer word in this
|
|
37
|
+
* field; null takes the search's match.typingPrefixFrom. */
|
|
38
|
+
typingPrefixFrom?: number | null;
|
|
23
39
|
}
|
package/dist/filters.d.ts
CHANGED
|
@@ -9,10 +9,55 @@ export interface RangeFilterProxy {
|
|
|
9
9
|
export interface ValueFilterProxy {
|
|
10
10
|
fieldName: string;
|
|
11
11
|
value?: any | null;
|
|
12
|
+
/** Match the value's casing exactly; off by default, so "fire" also matches Fire and FIRE. */
|
|
13
|
+
isCaseSensitive?: boolean;
|
|
12
14
|
}
|
|
15
|
+
/** The body of POST filters/in: documents whose field holds one of the values, as one filter.
|
|
16
|
+
* Numbers compare as numbers on a numeric field. */
|
|
17
|
+
export interface InFilterProxy {
|
|
18
|
+
fieldName: string;
|
|
19
|
+
values: Array<string | number | boolean>;
|
|
20
|
+
isCaseSensitive?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/** The body of POST filters/position: documents within `withinMeter` metres of a position. The
|
|
23
|
+
* field is an object `{ latitude, longitude }` whose two numbers are Filterable. */
|
|
24
|
+
export interface PositionFilterProxy {
|
|
25
|
+
fieldName: string;
|
|
26
|
+
latitude: number;
|
|
27
|
+
longitude: number;
|
|
28
|
+
withinMeter: number;
|
|
29
|
+
}
|
|
30
|
+
/** The body of POST filters/expression: `brand IN ["nike", "puma"] AND price BETWEEN 100 AND 2000`;
|
|
31
|
+
* `parameters` gives the filter token for each `$name` placeholder. */
|
|
32
|
+
export interface FilterExpressionProxy {
|
|
33
|
+
expression: string;
|
|
34
|
+
parameters?: {
|
|
35
|
+
[name: string]: FilterProxy;
|
|
36
|
+
} | null;
|
|
37
|
+
}
|
|
38
|
+
/** The answer of POST filters/expression: the filter's token, and the expression as the engine
|
|
39
|
+
* reads it (values case-folded as compared); null `canonical` when a placeholder has no expression. */
|
|
40
|
+
export interface FilterExpressionResultProxy {
|
|
41
|
+
hashString: string;
|
|
42
|
+
canonical?: string | null;
|
|
43
|
+
}
|
|
44
|
+
/** One error of an expression that makes no filter, in a 400 `invalidFilterExpression`'s `errors`. */
|
|
45
|
+
export interface FilterExpressionErrorDetail {
|
|
46
|
+
kind: 'syntax' | 'unknownField' | 'fieldNotFilterable' | 'typeMismatch' | 'invalidNumber' | 'emptyRange' | 'limitExceeded' | 'unknownParameter' | 'invalidValue' | 'notInitialized' | (string & {});
|
|
47
|
+
message: string;
|
|
48
|
+
/** Where in the expression, in characters. */
|
|
49
|
+
start: number;
|
|
50
|
+
length: number;
|
|
51
|
+
/** A correction, when one is likely (a field name close to the one typed). */
|
|
52
|
+
suggestion?: string | null;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The body of POST filters/combine: two or more filters combined with AND or OR into one
|
|
56
|
+
* filter. One request for the whole list; the same set in any order gives the same token, and
|
|
57
|
+
* one filter gives its own.
|
|
58
|
+
*/
|
|
13
59
|
export interface CombinedFilterProxy {
|
|
14
|
-
|
|
15
|
-
b: FilterProxy;
|
|
60
|
+
filters: FilterProxy[];
|
|
16
61
|
useAndOperation: boolean;
|
|
17
62
|
}
|
|
18
63
|
export interface UpdateFieldProxy {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
export { SystemState, BoostStrength, SynonymDirection } from './enums';
|
|
1
|
+
export { SystemState, BoostStrength, BuryStrength, SynonymDirection, SearchMode, Tolerance, Rungs, IndexTerms } from './enums';
|
|
2
2
|
export { JsonErrorType } from './errors';
|
|
3
3
|
export { LoginInfo, LoginResponse, ChangePasswordRequest } from './auth';
|
|
4
|
-
export { QueryProxy,
|
|
5
|
-
export { FilterProxy, RangeFilterProxy, ValueFilterProxy, CombinedFilterProxy, UpdateFieldProxy, FilterFieldUpdateProxy } from './filters';
|
|
6
|
-
export {
|
|
4
|
+
export { QueryProxy, MatchSetup, CandidateSetup, RankingProxy } from './query';
|
|
5
|
+
export { FilterProxy, RangeFilterProxy, ValueFilterProxy, CombinedFilterProxy, InFilterProxy, PositionFilterProxy, FilterExpressionProxy, FilterExpressionResultProxy, FilterExpressionErrorDetail, UpdateFieldProxy, FilterFieldUpdateProxy } from './filters';
|
|
6
|
+
export { RuleCondition, BoostRule, BuryRule, DatasetQueryParameters, QueryParametersResponse, FieldProfile, FieldProfileView, FieldProfilesResponse, FieldProfilesRequest } from './rules';
|
|
7
|
+
export { BoostProxy, BuryProxy } from './boost';
|
|
7
8
|
export { SynonymList, SynonymEntry } from './synonyms';
|
|
8
9
|
export { VectorQueryProxy, HybridQueryProxy, EmbeddingResultEntry } from './vector';
|
|
9
|
-
export { Result, ScoreEntry } from './result';
|
|
10
|
+
export { Result, QueryFitResult, ScoreEntry, ToleranceCounts, PageFill, MatchReport, RecordMatch, QueryWordMatch, WordMatch } from './result';
|
|
10
11
|
export { SystemStatus, LicenseInfo } from './status';
|
|
11
12
|
export { ParseResult, ProcessError, ProcessErrorCount } from './errors';
|
|
12
13
|
export { IndxProblem, IndxProblemCode } from './problem';
|
package/dist/index.js
CHANGED
package/dist/problem.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FilterExpressionErrorDetail } from './filters';
|
|
1
2
|
/**
|
|
2
3
|
* Machine-readable error code carried by every Indx error response, as the `code`
|
|
3
4
|
* extension of an RFC 9457 problem document. Switch on this, not on the HTTP status: a 400 can
|
|
@@ -16,8 +17,11 @@
|
|
|
16
17
|
* operator enabled per-key limits; or too many calls from this address carried no bearer token
|
|
17
18
|
* that validates (missing, expired or invalid). Carries `retryAfterSeconds` and a `Retry-After`
|
|
18
19
|
* header; wait that long and retry.
|
|
20
|
+
* - `invalidFilterExpression` (400): a filter expression makes no filter; `errors` holds each
|
|
21
|
+
* error with its place. Fix the expression; never retry without it.
|
|
22
|
+
* - `insufficientKeyScope` (403): the API key's access level is below the call.
|
|
19
23
|
*/
|
|
20
|
-
export type IndxProblemCode = 'invalidArgument' | 'invalidDatasetName' | 'loadFailed' | 'operationFailed' | 'unknownFilter' | 'invalidCredentials' | 'emailNotConfirmed' | 'insufficientRole' | 'datasetNotFound' | 'documentNotFound' | 'teamNotFound' | 'invalidState' | 'shadowBusy' | 'rateLimited';
|
|
24
|
+
export type IndxProblemCode = 'invalidArgument' | 'invalidDatasetName' | 'loadFailed' | 'operationFailed' | 'unknownFilter' | 'invalidCredentials' | 'emailNotConfirmed' | 'insufficientRole' | 'datasetNotFound' | 'documentNotFound' | 'teamNotFound' | 'invalidState' | 'shadowBusy' | 'rateLimited' | 'invalidFilterExpression' | 'insufficientKeyScope' | 'userNotFound' | 'passwordChangeFailed' | 'statisticsDisabled' | 'searchOrAskDisabled' | 'searchOrAskUnavailable' | 'searchOrAskBudgetSpent' | 'webhookNotFound' | 'heldBatchNotFound' | 'datasetBusy' | 'badSignature' | 'internalError';
|
|
21
25
|
/**
|
|
22
26
|
* An Indx error response body (`application/problem+json`, RFC 9457) with the `code`
|
|
23
27
|
* extension every endpoint adds. 401 from the JWT middleware comes without a body.
|
|
@@ -43,6 +47,9 @@ export interface IndxProblem {
|
|
|
43
47
|
errorMessage?: string;
|
|
44
48
|
/** `rateLimited` only: seconds until the window opens again (also the `Retry-After` header). */
|
|
45
49
|
retryAfterSeconds?: number;
|
|
46
|
-
/** Registration / password endpoints: per-field validation messages
|
|
47
|
-
|
|
50
|
+
/** Registration / password endpoints: per-field validation messages; `invalidFilterExpression`:
|
|
51
|
+
* each error of the expression with its place. */
|
|
52
|
+
errors?: string[] | FilterExpressionErrorDetail[];
|
|
53
|
+
/** `invalidFilterExpression` only: the expression with a caret under the first error. */
|
|
54
|
+
pointer?: string;
|
|
48
55
|
}
|
package/dist/query.d.ts
CHANGED
|
@@ -1,35 +1,86 @@
|
|
|
1
1
|
import { FilterProxy } from './filters';
|
|
2
|
-
import { BoostProxy } from './boost';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
2
|
+
import { BoostProxy, BuryProxy } from './boost';
|
|
3
|
+
import { IndexTerms, Rungs, SearchMode, Tolerance } from './enums';
|
|
4
|
+
/** What counts as a hit. Every member optional: a member left out is the server's default. */
|
|
5
|
+
export interface MatchSetup {
|
|
6
|
+
/** The most a word may differ by; caps each field's own (FieldProxy.tolerance). Default TwoEdits. */
|
|
7
|
+
tolerance?: Tolerance;
|
|
8
|
+
/** Fewest (the default): the first rung with hits. All: every rung up to the tolerance. */
|
|
9
|
+
rungs?: Rungs;
|
|
10
|
+
/** The shortest word given one edit (3), two (6) and three (9, where the tolerance is ThreeEdits); 0 is never. */
|
|
11
|
+
oneEditFrom?: number;
|
|
12
|
+
twoEditsFrom?: number;
|
|
13
|
+
threeEditsFrom?: number;
|
|
14
|
+
/** Where the cursor is in the text: the word it is in is the one being typed. Null: the last word. */
|
|
15
|
+
cursorAt?: number | null;
|
|
16
|
+
/** The word being typed also as the start of a longer word from this many letters (3), and within one edit from (6). */
|
|
17
|
+
typingPrefixFrom?: number;
|
|
18
|
+
typingPrefixOneEditFrom?: number;
|
|
19
|
+
/** Words written together or apart count as the word. Default true. */
|
|
20
|
+
joinedWords?: boolean;
|
|
16
21
|
}
|
|
22
|
+
/** Who comes in. */
|
|
23
|
+
export interface CandidateSetup {
|
|
24
|
+
/** The candidates per row asked for (4): the bound is the rows times this, at most 5 000. */
|
|
25
|
+
candidatesPerRow?: number;
|
|
26
|
+
/** The bound itself, when set. */
|
|
27
|
+
maxCandidates?: number | null;
|
|
28
|
+
/** Which terms BM25F scores with. Default Both. */
|
|
29
|
+
indexTerms?: IndexTerms;
|
|
30
|
+
/** When no record holds every word: the most words, then pattern matches (isFallback). Default true. */
|
|
31
|
+
fallback?: boolean;
|
|
32
|
+
/** In EditDistance, BM25F's best not counted below the counted set, counted (toleranceCounts.rest)
|
|
33
|
+
* and in the facets. Default false. */
|
|
34
|
+
rest?: boolean;
|
|
35
|
+
/** A page short of the rows filled, below the counted and not counted, with the records holding
|
|
36
|
+
* the most of the words (result.fill.mostWords). Default false. */
|
|
37
|
+
fillWithMostWords?: boolean;
|
|
38
|
+
/** How many typo levels past the counted one fill a short page, below it and not counted: 0 no
|
|
39
|
+
* fill (default), 1 the next level, 2 up to two typos. */
|
|
40
|
+
fillReach?: number;
|
|
41
|
+
}
|
|
42
|
+
/** The order inside the rungs, with the boosts and buries as the tokens their endpoints give. */
|
|
43
|
+
export interface RankingProxy {
|
|
44
|
+
/** Whether Coverage reranks the candidates, in either mode. Default true. */
|
|
45
|
+
rerank?: boolean;
|
|
46
|
+
/** Coverage's share of the score, 0 to 1. Default 0.2. */
|
|
47
|
+
share?: number;
|
|
48
|
+
/** How far the share moves towards Coverage while the last word is typed. Default 0.5. */
|
|
49
|
+
typingShift?: number;
|
|
50
|
+
longFieldFrom?: number;
|
|
51
|
+
longFieldWeightFloor?: number;
|
|
52
|
+
/** The whole query in a field floors the score. Default true. */
|
|
53
|
+
wholeQueryFloor?: boolean;
|
|
54
|
+
/** Per field, its Coverage weight in this search. */
|
|
55
|
+
fieldWeights?: Record<string, number> | null;
|
|
56
|
+
/** Per field, a boost inside BM25F's saturation. */
|
|
57
|
+
fieldBoosts?: Record<string, number> | null;
|
|
58
|
+
/** A list that is not empty is on; the dataset's boost rules apply to every search beside them. */
|
|
59
|
+
boosts?: BoostProxy[] | null;
|
|
60
|
+
buries?: BuryProxy[] | null;
|
|
61
|
+
}
|
|
62
|
+
/** A search, as `POST .../search` takes it (6.0). */
|
|
17
63
|
export interface QueryProxy {
|
|
18
64
|
text?: string | null;
|
|
19
65
|
maxNumberOfRecordsToReturn?: number;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
66
|
+
/** Default Coverage. */
|
|
67
|
+
mode?: SearchMode;
|
|
68
|
+
/** Null or left out: the defaults. */
|
|
69
|
+
match?: MatchSetup | null;
|
|
70
|
+
candidates?: CandidateSetup | null;
|
|
71
|
+
ranking?: RankingProxy | null;
|
|
72
|
+
/** Return `matchReport`, in any mode: how each query word was met in each record. */
|
|
73
|
+
enableMatchReport?: boolean;
|
|
23
74
|
enableFacets?: boolean;
|
|
24
|
-
enableBoost?: boolean;
|
|
25
75
|
removeDuplicates?: boolean;
|
|
26
76
|
sortAscending?: boolean;
|
|
27
77
|
sortBy?: string | null;
|
|
28
78
|
timeOutLimitMilliseconds?: number;
|
|
29
79
|
filter?: FilterProxy | null;
|
|
30
|
-
|
|
31
|
-
|
|
80
|
+
/** A filter expression, ANDed with `filter` when both are given. */
|
|
81
|
+
filterExpression?: string | null;
|
|
82
|
+
filterParameters?: Record<string, FilterProxy> | null;
|
|
32
83
|
logPrefix?: string | null;
|
|
84
|
+
/** The result then also says how well it explains the text: a {@link QueryFitResult}. */
|
|
85
|
+
measureFit?: boolean;
|
|
33
86
|
}
|
|
34
|
-
/** @deprecated Renamed to {@link QueryProxy} in 2.3.0 (the server dropped its "cloud" vocabulary); removed in 3.0. */
|
|
35
|
-
export type CloudQuery = QueryProxy;
|
package/dist/result.d.ts
CHANGED
|
@@ -1,14 +1,87 @@
|
|
|
1
1
|
import { StringInt32KeyValuePair } from './common';
|
|
2
|
+
import { SystemState, Tolerance } from './enums';
|
|
3
|
+
import { ProcessError } from './errors';
|
|
2
4
|
export interface ScoreEntry {
|
|
3
5
|
documentKey: number;
|
|
4
6
|
score: number;
|
|
5
7
|
}
|
|
8
|
+
/** How Coverage met a query word in a record. */
|
|
9
|
+
export type WordMatch = 'NotFound' | 'Whole' | 'Prefix' | 'Suffix' | 'Joined' | 'RunTogether' | 'OneEdit' | 'TwoEdits' | 'ThreeEdits' | 'Synonym' | number;
|
|
10
|
+
export interface QueryWordMatch {
|
|
11
|
+
word: string;
|
|
12
|
+
/** The field that confirmed the word; null when none did. */
|
|
13
|
+
field?: string | null;
|
|
14
|
+
how: WordMatch;
|
|
15
|
+
}
|
|
16
|
+
export interface RecordMatch {
|
|
17
|
+
documentKey: number;
|
|
18
|
+
/** The query's words, in its order. */
|
|
19
|
+
words: QueryWordMatch[];
|
|
20
|
+
}
|
|
21
|
+
/** How each query word was met in the returned records (query.enableMatchReport). */
|
|
22
|
+
export interface MatchReport {
|
|
23
|
+
/** Per record, in the order of `records`. */
|
|
24
|
+
matches?: RecordMatch[] | null;
|
|
25
|
+
/** Per field: how many query words were met each way, over the returned records. */
|
|
26
|
+
matchesByField?: {
|
|
27
|
+
[field: string]: {
|
|
28
|
+
[how: string]: number;
|
|
29
|
+
};
|
|
30
|
+
} | null;
|
|
31
|
+
}
|
|
32
|
+
/** How many listed records fill a short page, and from where (result.fill). */
|
|
33
|
+
export interface PageFill {
|
|
34
|
+
nextRungs: number;
|
|
35
|
+
mostWords: number;
|
|
36
|
+
}
|
|
37
|
+
/** How many records hold every query word on each rung, each with those before it; a rung not
|
|
38
|
+
* worked out is null. */
|
|
39
|
+
export interface ToleranceCounts {
|
|
40
|
+
exact: number;
|
|
41
|
+
oneEdit?: number | null;
|
|
42
|
+
twoEdits?: number | null;
|
|
43
|
+
threeEdits?: number | null;
|
|
44
|
+
/** With candidates.rest: the counted rung and the rest taken below it, up to the bound. */
|
|
45
|
+
rest?: number | null;
|
|
46
|
+
/** Of the counted, those holding a run of words only through a synonym; null when none fired. */
|
|
47
|
+
throughSynonym?: number | null;
|
|
48
|
+
}
|
|
6
49
|
export interface Result {
|
|
7
50
|
records?: ScoreEntry[] | null;
|
|
8
51
|
facets?: {
|
|
9
52
|
[key: string]: StringInt32KeyValuePair[];
|
|
10
53
|
} | null;
|
|
11
54
|
didTimeOut: boolean;
|
|
12
|
-
|
|
13
|
-
|
|
55
|
+
/** Set when the search was refused rather than finding nothing. */
|
|
56
|
+
reason?: ProcessError | null;
|
|
57
|
+
systemState?: SystemState;
|
|
58
|
+
/** The count; null in Bm25f mode. Until 6.0 the result carried truncationIndex and truncationScore. */
|
|
59
|
+
toleranceCounts?: ToleranceCounts | null;
|
|
60
|
+
/** The rung the list was taken from; null when nothing was counted. */
|
|
61
|
+
countedTolerance?: Tolerance | null;
|
|
62
|
+
/** How many records answer, in every mode: the rung counted (with the rest), the fallback's most
|
|
63
|
+
* words, every record BM25F scored, or every record the filter lets through in an empty search.
|
|
64
|
+
* count > ranked: an overflow at the depth. Until 2 Nov 2026 `overflow`. */
|
|
65
|
+
count?: number;
|
|
66
|
+
/** How many were ranked, at most the candidate bound. ranked > records.length: an overflow at the rows. */
|
|
67
|
+
ranked?: number;
|
|
68
|
+
/** Nothing was counted: the records holding the most of the words, then pattern matches. */
|
|
69
|
+
isFallback?: boolean;
|
|
70
|
+
/** Null unless the query asked for it. */
|
|
71
|
+
matchReport?: MatchReport | null;
|
|
72
|
+
/** Whether the reranker ordered the list (ranking.rerank as the search ran it). */
|
|
73
|
+
reranked?: boolean;
|
|
74
|
+
/** How many listed records fill a short page, not counted: from the next typo levels (every
|
|
75
|
+
* word), then holding the most of the words. In that order after the counted records. Null
|
|
76
|
+
* without the word lookup (Bm25f mode). */
|
|
77
|
+
fill?: PageFill | null;
|
|
78
|
+
}
|
|
79
|
+
/** A {@link Result} of a search with `measureFit`: how well the results explain the text. */
|
|
80
|
+
export interface QueryFitResult extends Result {
|
|
81
|
+
/** Share of the query's weight (its words' IDF) the best explaining result explains, 0 to 1. */
|
|
82
|
+
explainedShare: number;
|
|
83
|
+
/** Share carried by informative words no result explains, 0 to 1. */
|
|
84
|
+
unexplainedShare: number;
|
|
85
|
+
explainedWords: string[];
|
|
86
|
+
unexplainedWords: string[];
|
|
14
87
|
}
|
package/dist/rules.d.ts
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { BoostStrength, BuryStrength, SearchMode } from './enums';
|
|
2
|
+
import { CandidateSetup, MatchSetup, RankingProxy } from './query';
|
|
3
|
+
import { Tolerance } from './enums';
|
|
4
|
+
/** A condition of a saved boost or bury rule: a value, or a range on a number field. */
|
|
5
|
+
export interface RuleCondition {
|
|
6
|
+
field?: string | null;
|
|
7
|
+
/** The value form; ignored when `min` or `max` is set. */
|
|
8
|
+
value?: string | null;
|
|
9
|
+
/** The range form, inclusive; null is open. */
|
|
10
|
+
min?: number | null;
|
|
11
|
+
max?: number | null;
|
|
12
|
+
/** Read only: whether this is the range form. */
|
|
13
|
+
readonly isRange?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/** A saved boost rule (GET/PUT boosts), applied to every search of the dataset while it is
|
|
16
|
+
* enabled and inside its dates. */
|
|
17
|
+
export interface BoostRule {
|
|
18
|
+
name?: string | null;
|
|
19
|
+
enabled: boolean;
|
|
20
|
+
conditions?: RuleCondition[] | null;
|
|
21
|
+
join: 'And' | 'Or';
|
|
22
|
+
strength: BoostStrength;
|
|
23
|
+
/** ISO dates; null is open. */
|
|
24
|
+
activeFrom?: string | null;
|
|
25
|
+
activeUntil?: string | null;
|
|
26
|
+
}
|
|
27
|
+
/** A saved bury rule (GET/PUT buries): the documents it holds are scored lower; nothing else moves. */
|
|
28
|
+
export interface BuryRule extends Omit<BoostRule, 'strength'> {
|
|
29
|
+
strength: BuryStrength;
|
|
30
|
+
}
|
|
31
|
+
/** A dataset's query parameters: what its searches take where they send none, member by member. */
|
|
32
|
+
export interface DatasetQueryParameters {
|
|
33
|
+
mode?: SearchMode | null;
|
|
34
|
+
match?: MatchSetup | null;
|
|
35
|
+
candidates?: CandidateSetup | null;
|
|
36
|
+
ranking?: RankingProxy | null;
|
|
37
|
+
}
|
|
38
|
+
/** GET query-parameters: what the dataset sets (null elsewhere), and what a search that sends
|
|
39
|
+
* none of these values runs with, every value filled in. */
|
|
40
|
+
export interface QueryParametersResponse {
|
|
41
|
+
parameters: DatasetQueryParameters;
|
|
42
|
+
effective: DatasetQueryParameters;
|
|
43
|
+
}
|
|
44
|
+
/** A field profile: a searched field's tolerance, rerank weight and pattern setup under one name. */
|
|
45
|
+
export interface FieldProfile {
|
|
46
|
+
id: string;
|
|
47
|
+
name: string;
|
|
48
|
+
about?: string | null;
|
|
49
|
+
builtIn?: boolean;
|
|
50
|
+
tolerance: Tolerance;
|
|
51
|
+
rerankWeight: number;
|
|
52
|
+
indexSizes: number[];
|
|
53
|
+
numberOfStartCharacters: number;
|
|
54
|
+
numberOfStopCharacters: number;
|
|
55
|
+
typingPrefixFrom?: number | null;
|
|
56
|
+
}
|
|
57
|
+
/** A profile as GET fields/profiles shows it: whether this dataset changed a built-in, and the
|
|
58
|
+
* fields that have it. */
|
|
59
|
+
export interface FieldProfileView extends FieldProfile {
|
|
60
|
+
edited: boolean;
|
|
61
|
+
fields: string[];
|
|
62
|
+
}
|
|
63
|
+
/** GET fields/profiles. */
|
|
64
|
+
export interface FieldProfilesResponse {
|
|
65
|
+
profiles: FieldProfileView[];
|
|
66
|
+
/** Field name to profile id. */
|
|
67
|
+
assignments: {
|
|
68
|
+
[field: string]: string;
|
|
69
|
+
};
|
|
70
|
+
/** Searched fields with settings of their own, no profile. */
|
|
71
|
+
custom: string[];
|
|
72
|
+
/** The profile a field gets when it becomes searched. */
|
|
73
|
+
defaultProfileId: string;
|
|
74
|
+
}
|
|
75
|
+
/** PUT fields/profiles. A part left out (null) is left as it is: `profiles` is the dataset's own
|
|
76
|
+
* list, whole; `assignments` gives fields a profile by id, or null for none. */
|
|
77
|
+
export interface FieldProfilesRequest {
|
|
78
|
+
profiles?: FieldProfile[] | null;
|
|
79
|
+
assignments?: {
|
|
80
|
+
[field: string]: string | null;
|
|
81
|
+
} | null;
|
|
82
|
+
defaultProfileId?: string | null;
|
|
83
|
+
}
|
package/dist/status.d.ts
CHANGED
|
@@ -21,9 +21,14 @@ export interface SystemStatus {
|
|
|
21
21
|
invalidDataSetName: boolean;
|
|
22
22
|
invalidState: boolean;
|
|
23
23
|
invalidArgument: boolean;
|
|
24
|
-
|
|
24
|
+
/** A query's text was over the length a search takes, and the search was refused. */
|
|
25
25
|
tooLongSearchText: boolean;
|
|
26
|
-
|
|
26
|
+
/** A record's text was cut at the length the index takes (the record is stored whole). */
|
|
27
|
+
indexedTextTruncated: boolean;
|
|
28
|
+
/** A word longer than the configuration takes was cut to it. */
|
|
29
|
+
wordTokenSizeCapped: boolean;
|
|
30
|
+
/** A field's own k1 is set on a BM25F dataset, where the dataset's k1 is used instead. */
|
|
31
|
+
fieldK1Ignored: boolean;
|
|
27
32
|
licenseInfo: LicenseInfo;
|
|
28
33
|
recoverableErrors?: ProcessErrorCount[] | null;
|
|
29
34
|
unrecoverableErrors?: ProcessError[] | null;
|
|
@@ -36,6 +41,13 @@ export interface SystemStatus {
|
|
|
36
41
|
recordsOnDisk: number;
|
|
37
42
|
/** Fields in the stored field configuration; 0 = not analyzed. */
|
|
38
43
|
fieldsDiscovered: number;
|
|
44
|
+
/** True while a rebuild on a shadow engine runs. `PUT fields/configuration` and
|
|
45
|
+
* `POST index` on a Ready dataset answer 202 as soon as one is started. */
|
|
39
46
|
shadowBuildInProgress: boolean;
|
|
40
47
|
shadowBuildStartedUtc?: string | null;
|
|
48
|
+
/** When the last rebuild ended; null while one runs and before the first. */
|
|
49
|
+
shadowBuildFinishedUtc?: string | null;
|
|
50
|
+
/** Why the last rebuild failed, or null. A failed rebuild swaps nothing in: the dataset
|
|
51
|
+
* keeps serving with the documents and field configuration it had. */
|
|
52
|
+
shadowBuildError?: string | null;
|
|
41
53
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@indxsearch/indx-types",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-beta.0",
|
|
4
4
|
"description": "TypeScript type definitions for Indx v2. Provides complete types for search queries, filters, boosts, results, and system status based on the official Swagger specification.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"indx",
|
package/dist/access.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export interface DataSetListDto {
|
|
2
|
-
name: string;
|
|
3
|
-
ownerUserId?: string | null;
|
|
4
|
-
/** "owner" | "editor" | "viewer" */
|
|
5
|
-
role: string;
|
|
6
|
-
}
|
|
7
|
-
export interface AccessGrantDto {
|
|
8
|
-
email: string;
|
|
9
|
-
/** "editor" | "viewer" */
|
|
10
|
-
role: string;
|
|
11
|
-
}
|
|
12
|
-
export interface GrantAccessRequest {
|
|
13
|
-
granteeEmail: string;
|
|
14
|
-
/** "editor" | "viewer" */
|
|
15
|
-
role: string;
|
|
16
|
-
}
|
|
17
|
-
export interface TransferOwnershipRequest {
|
|
18
|
-
newOwnerEmail: string;
|
|
19
|
-
}
|
|
File without changes
|