@indxsearch/indx-types 4.0.0-beta.1 → 4.0.0-beta.3

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.0.0-beta.3
4
+
5
+ ### Minor Changes
6
+
7
+ - 1feb6a4: `key` on search results, match reports and vector results: the record's key as text, for datasets whose keys are text.
8
+
9
+ ## 4.0.0-beta.2
10
+
11
+ ### Minor Changes
12
+
13
+ - Types for one search per keystroke: `GroupedSearchRequest`, `SearchGroup` and `GroupedSearchResult` for `search/groups` (one text answered in named sections, each with its own filter, rows and count), `MultiSearchQuery` for a `search/multi` search that says for itself whether it counts in the statistics, and `includeFields` on `QueryProxy` to get only the record fields a page shows. Also on `QueryProxy`: `collapseBy` (one record per value of a field, such as one row per title), `counts` (named counts in the same search, read from the result's `counts`), and `facetSelections` and `facetRanges` (facets that leave out their own selection, for OR within a facet group). `removeDuplicates` is gone: the server never acted on it.
14
+
3
15
  ## 4.0.0-beta.1
4
16
 
5
17
  ### Minor Changes
@@ -0,0 +1,19 @@
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
+ }
package/dist/access.js ADDED
@@ -0,0 +1 @@
1
+ export {};
package/dist/fields.d.ts CHANGED
@@ -21,7 +21,6 @@ export interface FieldProxy {
21
21
  numberOfStartCharacters?: number | null;
22
22
  numberOfStopCharacters?: number | null;
23
23
  embeddable?: boolean | null;
24
- preloadFilters?: boolean | null;
25
24
  /** Score weight multiplier (typical 1.0–3.0). Only meaningful when searchable. */
26
25
  weight?: number | null;
27
26
  /** Per-field length-normalisation parameter b. Range [0,1]. */
package/dist/index.d.ts CHANGED
@@ -1,13 +1,13 @@
1
1
  export { SystemState, BoostStrength, BuryStrength, SynonymDirection, SearchMode, Tolerance, Rungs, IndexTerms } from './enums.js';
2
2
  export { JsonErrorType } from './errors.js';
3
3
  export { LoginInfo, LoginResponse, ChangePasswordRequest } from './auth.js';
4
- export { QueryProxy, MatchSetup, CandidateSetup, RankingProxy } from './query.js';
4
+ export { QueryProxy, MatchSetup, CandidateSetup, RankingProxy, MultiSearchQuery, SearchGroup, GroupedSearchRequest } from './query.js';
5
5
  export { FilterProxy, RangeFilterProxy, ValueFilterProxy, CombinedFilterProxy, InFilterProxy, PositionFilterProxy, FilterExpressionProxy, FilterExpressionResultProxy, FilterExpressionErrorDetail, UpdateFieldProxy, FilterFieldUpdateProxy } from './filters.js';
6
6
  export { RuleCondition, BoostRule, BuryRule, DatasetQueryParameters, QueryParametersResponse, FieldProfile, FieldProfileView, FieldProfilesResponse, FieldProfilesRequest } from './rules.js';
7
7
  export { BoostProxy, BuryProxy } from './boost.js';
8
8
  export { SynonymList, SynonymEntry } from './synonyms.js';
9
9
  export { VectorQueryProxy, HybridQueryProxy, EmbeddingResultEntry } from './vector.js';
10
- export { Result, QueryFitResult, ScoreEntry, ToleranceCounts, PageFill, MatchReport, RecordMatch, QueryWordMatch, WordMatch, FacetStats, MultiSearchAnswer, MultiSearchFailure, MAX_SEARCHES_PER_MULTI } from './result.js';
10
+ export { Result, QueryFitResult, ScoreEntry, ToleranceCounts, PageFill, MatchReport, RecordMatch, QueryWordMatch, WordMatch, FacetStats, MultiSearchAnswer, MultiSearchFailure, MAX_SEARCHES_PER_MULTI, GroupedSearchResult } from './result.js';
11
11
  export { ColdVisibility, ColdWrite, ColdBatchItem, ColdBatchOutcome, ColdView } from './cold.js';
12
12
  export { SystemStatus, LicenseInfo } from './status.js';
13
13
  export { ParseResult, ProcessError, ProcessErrorCount } from './errors.js';
package/dist/query.d.ts CHANGED
@@ -13,7 +13,7 @@ export interface MatchSetup {
13
13
  threeEditsFrom?: number;
14
14
  /** Where the cursor is in the text: the word it is in is the one being typed. Null: the last word. */
15
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). */
16
+ /** The word being typed also as the start of a longer word from this many letters (2), and within one edit from (6). */
17
17
  typingPrefixFrom?: number;
18
18
  typingPrefixOneEditFrom?: number;
19
19
  /** Words written together or apart count as the word. Default true. */
@@ -83,7 +83,23 @@ export interface QueryProxy {
83
83
  /** The records' JSON comes with the result, in `documents`, in the order of `records`: one call
84
84
  * instead of a search and a lookup. Default false. */
85
85
  includeDocuments?: boolean;
86
- removeDuplicates?: boolean;
86
+ /** With includeDocuments: only these top-level fields of each record. Null or empty: the whole record. */
87
+ includeFields?: string[] | null;
88
+ /** One record per value of these fields, in the ranking's order: the best-ranked kept, the next
89
+ * with a value not seen taking a duplicate's place; `offset` counts the records kept. Each field
90
+ * must have a role and not be an array. With includeFields, these fields must be among them. */
91
+ collapseBy?: string[] | null;
92
+ /** Named counts, each a filter expression: how many of the records `count` counts each lets
93
+ * through, in the result's `counts`. Counted over the same set as the facets, so no extra search;
94
+ * not the count a separate search with that filter would give where the typo levels differ. */
95
+ counts?: Record<string, string> | null;
96
+ /** The values ticked on facets, by Facetable field: the list holds records with one of a field's
97
+ * values (OR within a field, AND between fields and with the filter), and each selected field's
98
+ * facet is counted without its own selection. */
99
+ facetSelections?: Record<string, string[]> | null;
100
+ /** A range on a facet, by field: a filter expression on that field alone (`publishedYear >= 2010`),
101
+ * the field Facetable and Filterable. Its facet and facetStats are counted without it. */
102
+ facetRanges?: Record<string, string> | null;
87
103
  sortAscending?: boolean;
88
104
  sortBy?: string | null;
89
105
  timeOutLimitMilliseconds?: number;
@@ -95,3 +111,33 @@ export interface QueryProxy {
95
111
  /** The result then also says how well it explains the text: a {@link QueryFitResult}. */
96
112
  measureFit?: boolean;
97
113
  }
114
+ /** One search of `POST .../search/multi`: a search that may say for itself how it goes into the
115
+ * statistics, over the query string's `?count=`, `?source=` and `?session=`. */
116
+ export interface MultiSearchQuery extends QueryProxy {
117
+ /** Whether this search is a visitor's; left out: the query string's. */
118
+ count?: boolean | null;
119
+ source?: string | null;
120
+ session?: string | null;
121
+ }
122
+ /** One section of a {@link GroupedSearchRequest}. */
123
+ export interface SearchGroup {
124
+ /** The section's key in the answer's `groups`; unique in the request. */
125
+ name: string;
126
+ /** A filter expression for the section, ANDed with the search's own `filterExpression`. */
127
+ filter?: string | null;
128
+ /** How many records the section lists; 0 lists none and still counts. */
129
+ rows: number;
130
+ /** Count by this filter instead of `filter`: list the upcoming events, count them all. */
131
+ countFilter?: string | null;
132
+ /** The section's own candidates, ranking and match, each replacing the search's whole. */
133
+ candidates?: CandidateSetup | null;
134
+ ranking?: RankingProxy | null;
135
+ match?: MatchSetup | null;
136
+ /** The section that is the visitor's search, the one recorded in the statistics; none marked: the first. */
137
+ primary?: boolean;
138
+ }
139
+ /** The body of `POST .../search/groups`: one text answered in named sections. Everything but
140
+ * `groups` is every section's. At most 20 groups. */
141
+ export interface GroupedSearchRequest extends QueryProxy {
142
+ groups: SearchGroup[];
143
+ }
package/dist/result.d.ts CHANGED
@@ -4,6 +4,8 @@ import { ProcessError } from './errors.js';
4
4
  import { IndxProblem } from './problem.js';
5
5
  export interface ScoreEntry {
6
6
  documentKey: number;
7
+ /** The key as text (6.0: keys are text); a text key's documentKey is past what a number holds exactly. */
8
+ key?: string;
7
9
  score: number;
8
10
  }
9
11
  /** How a query word was met in a record. */
@@ -16,6 +18,8 @@ export interface QueryWordMatch {
16
18
  }
17
19
  export interface RecordMatch {
18
20
  documentKey: number;
21
+ /** The key as text (6.0: keys are text); a text key's documentKey is past what a number holds exactly. */
22
+ key?: string;
19
23
  /** The query's words, in its order. */
20
24
  words: QueryWordMatch[];
21
25
  }
@@ -60,6 +64,8 @@ export interface Result<TDocument = Record<string, unknown>> {
60
64
  facets?: {
61
65
  [key: string]: StringInt32KeyValuePair[];
62
66
  } | null;
67
+ /** For each name in query.counts, how many of the records `count` counts its filter lets through. */
68
+ counts?: Record<string, number> | null;
63
69
  /** Per number field among the facets: its lowest and highest value and how many records hold one. */
64
70
  facetStats?: {
65
71
  [field: string]: FacetStats;
@@ -119,3 +125,11 @@ export interface MultiSearchFailure {
119
125
  }
120
126
  /** The most searches one `search/multi` call takes. */
121
127
  export declare const MAX_SEARCHES_PER_MULTI = 20;
128
+ /** The answer of `POST .../search/groups`: each section's result by its name, a failed one as its
129
+ * failure, and the one `queryId` a click in any section refers to. */
130
+ export interface GroupedSearchResult<TDocument = Record<string, unknown>> {
131
+ groups: {
132
+ [name: string]: Result<TDocument> | MultiSearchFailure;
133
+ };
134
+ queryId?: string | null;
135
+ }
package/dist/status.d.ts CHANGED
@@ -16,6 +16,12 @@ export interface LicenseInfo {
16
16
  export interface SystemStatus {
17
17
  systemState: SystemState;
18
18
  documentCount: number;
19
+ /** The filters kept between searches, how many there are. */
20
+ filterCacheFilters: number;
21
+ /** What the kept filters take, in bytes. */
22
+ filterCacheBytes: number;
23
+ /** The most they may take, in bytes: the dataset's filter cache in megabytes. 0 while it is not loaded. */
24
+ filterCacheLimitBytes: number;
19
25
  searchCounter: number;
20
26
  secondsToIndex: number;
21
27
  invalidDataSetName: boolean;
package/dist/vector.d.ts CHANGED
@@ -16,5 +16,7 @@ export interface HybridQueryProxy {
16
16
  }
17
17
  export interface EmbeddingResultEntry {
18
18
  documentKey: number;
19
+ /** The key as text (6.0: keys are text); a text key's documentKey is past what a number holds exactly. */
20
+ key?: string;
19
21
  score: number;
20
22
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indxsearch/indx-types",
3
- "version": "4.0.0-beta.1",
3
+ "version": "4.0.0-beta.3",
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",