@relevanceai/sdk 1.98.0 → 1.100.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.
|
@@ -894,6 +894,14 @@ class DiscoveryApiClient extends BaseClient_1._GenericClient {
|
|
|
894
894
|
options
|
|
895
895
|
});
|
|
896
896
|
}
|
|
897
|
+
async AppendTags(input, options) {
|
|
898
|
+
return this.SendRequest({
|
|
899
|
+
input,
|
|
900
|
+
method: 'post',
|
|
901
|
+
path: '/datasets/{dataset_id}/tags/append',
|
|
902
|
+
options
|
|
903
|
+
});
|
|
904
|
+
}
|
|
897
905
|
async DeleteTags(input, options) {
|
|
898
906
|
return this.SendRequest({
|
|
899
907
|
input,
|
|
@@ -1398,6 +1398,18 @@ var DiscoveryApiClient = /** @class */ (function (_super) {
|
|
|
1398
1398
|
});
|
|
1399
1399
|
});
|
|
1400
1400
|
};
|
|
1401
|
+
DiscoveryApiClient.prototype.AppendTags = function (input, options) {
|
|
1402
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1403
|
+
return __generator(this, function (_a) {
|
|
1404
|
+
return [2 /*return*/, this.SendRequest({
|
|
1405
|
+
input: input,
|
|
1406
|
+
method: 'post',
|
|
1407
|
+
path: '/datasets/{dataset_id}/tags/append',
|
|
1408
|
+
options: options
|
|
1409
|
+
})];
|
|
1410
|
+
});
|
|
1411
|
+
});
|
|
1412
|
+
};
|
|
1401
1413
|
DiscoveryApiClient.prototype.DeleteTags = function (input, options) {
|
|
1402
1414
|
return __awaiter(this, void 0, void 0, function () {
|
|
1403
1415
|
return __generator(this, function (_a) {
|
|
@@ -222,6 +222,8 @@ export declare type BulkUpdateInput = operations['BulkUpdate']['requestBody']['c
|
|
|
222
222
|
export declare type BulkUpdateOutput = operations['BulkUpdate']['responses']['200']['content']['application/json'];
|
|
223
223
|
export declare type UpdateWhereInput = operations['UpdateWhere']['requestBody']['content']['application/json'];
|
|
224
224
|
export declare type UpdateWhereOutput = operations['UpdateWhere']['responses']['200']['content']['application/json'];
|
|
225
|
+
export declare type AppendTagsInput = operations['AppendTags']['requestBody']['content']['application/json'];
|
|
226
|
+
export declare type AppendTagsOutput = operations['AppendTags']['responses']['200']['content']['application/json'];
|
|
225
227
|
export declare type DeleteTagsInput = operations['DeleteTags']['requestBody']['content']['application/json'];
|
|
226
228
|
export declare type DeleteTagsOutput = operations['DeleteTags']['responses']['200']['content']['application/json'];
|
|
227
229
|
export declare type MergeTagsInput = operations['MergeTags']['requestBody']['content']['application/json'];
|
|
@@ -397,6 +399,7 @@ export declare class DiscoveryApiClient extends _GenericClient {
|
|
|
397
399
|
DeleteDocumentFields(input: CommandInput<DeleteDocumentFieldsInput>, options?: _GenericMethodOptions): Promise<CommandOutput<DeleteDocumentFieldsOutput>>;
|
|
398
400
|
BulkUpdate(input: CommandInput<BulkUpdateInput>, options?: _GenericMethodOptions): Promise<CommandOutput<BulkUpdateOutput>>;
|
|
399
401
|
UpdateWhere(input: CommandInput<UpdateWhereInput>, options?: _GenericMethodOptions): Promise<CommandOutput<UpdateWhereOutput>>;
|
|
402
|
+
AppendTags(input: CommandInput<AppendTagsInput>, options?: _GenericMethodOptions): Promise<CommandOutput<AppendTagsOutput>>;
|
|
400
403
|
DeleteTags(input: CommandInput<DeleteTagsInput>, options?: _GenericMethodOptions): Promise<CommandOutput<DeleteTagsOutput>>;
|
|
401
404
|
MergeTags(input: CommandInput<MergeTagsInput>, options?: _GenericMethodOptions): Promise<CommandOutput<MergeTagsOutput>>;
|
|
402
405
|
ListFacets(input: CommandInput<ListFacetsInput>, options?: _GenericMethodOptions): Promise<CommandOutput<ListFacetsOutput>>;
|
|
@@ -1988,6 +1988,26 @@ export interface paths {
|
|
|
1988
1988
|
*/
|
|
1989
1989
|
post: operations["UpdateWhere"];
|
|
1990
1990
|
};
|
|
1991
|
+
"/datasets/{dataset_id}/tags/append": {
|
|
1992
|
+
/**
|
|
1993
|
+
* Append tags to tag field.
|
|
1994
|
+
*
|
|
1995
|
+
* ### Required permissions
|
|
1996
|
+
* > [
|
|
1997
|
+
* {
|
|
1998
|
+
* "actions": [
|
|
1999
|
+
* "datasets:write"
|
|
2000
|
+
* ],
|
|
2001
|
+
* "datasets": [
|
|
2002
|
+
* {
|
|
2003
|
+
* "params": "dataset_id"
|
|
2004
|
+
* }
|
|
2005
|
+
* ]
|
|
2006
|
+
* }
|
|
2007
|
+
* ]
|
|
2008
|
+
*/
|
|
2009
|
+
post: operations["AppendTags"];
|
|
2010
|
+
};
|
|
1991
2011
|
"/datasets/{dataset_id}/tags/delete": {
|
|
1992
2012
|
/**
|
|
1993
2013
|
* Delete tags from tag field by tag value. tag field can be in format ["cat"], or [{"label":"cat"}]
|
|
@@ -6940,7 +6960,46 @@ export interface components {
|
|
|
6940
6960
|
send_email?: boolean;
|
|
6941
6961
|
worker_number?: number;
|
|
6942
6962
|
};
|
|
6943
|
-
UpsertWorkflowStatusOutput:
|
|
6963
|
+
UpsertWorkflowStatusOutput: {
|
|
6964
|
+
creation_time?: string;
|
|
6965
|
+
completion_time?: string;
|
|
6966
|
+
notebook_path?: string;
|
|
6967
|
+
instance_type?: string;
|
|
6968
|
+
dataset_id?: string;
|
|
6969
|
+
params?: {
|
|
6970
|
+
[key: string]: unknown;
|
|
6971
|
+
};
|
|
6972
|
+
_id?: string;
|
|
6973
|
+
workflow_id?: string;
|
|
6974
|
+
metadata?: {
|
|
6975
|
+
[key: string]: unknown;
|
|
6976
|
+
};
|
|
6977
|
+
/** @description Status of the workflow. Used for knowing when to send an email notification. */
|
|
6978
|
+
status?: "complete" | "inprogress" | "failed";
|
|
6979
|
+
job_status?: "InProgress" | "Completed" | "Failed";
|
|
6980
|
+
worker_status?: {
|
|
6981
|
+
[key: string]: {
|
|
6982
|
+
status?: "complete" | "inprogress" | "failed";
|
|
6983
|
+
completion_time?: string;
|
|
6984
|
+
creation_time?: string;
|
|
6985
|
+
};
|
|
6986
|
+
};
|
|
6987
|
+
n_workers?: number;
|
|
6988
|
+
steps?: {
|
|
6989
|
+
[key: string]: {
|
|
6990
|
+
worker_progress?: {
|
|
6991
|
+
[key: string]: {
|
|
6992
|
+
n_processed?: number;
|
|
6993
|
+
n_total?: number;
|
|
6994
|
+
};
|
|
6995
|
+
};
|
|
6996
|
+
n_processed?: number;
|
|
6997
|
+
n_total?: number;
|
|
6998
|
+
};
|
|
6999
|
+
};
|
|
7000
|
+
} & {
|
|
7001
|
+
[key: string]: unknown;
|
|
7002
|
+
};
|
|
6944
7003
|
ListWorkflowTypesInput: unknown;
|
|
6945
7004
|
ListWorkflowTypesOutput: {
|
|
6946
7005
|
results: ({
|
|
@@ -7904,128 +7963,885 @@ export interface components {
|
|
|
7904
7963
|
/** @description The alias of the clustering. */
|
|
7905
7964
|
alias?: string;
|
|
7906
7965
|
};
|
|
7907
|
-
}[];
|
|
7908
|
-
/** @description A list of jobs to run once all documents are processed. */
|
|
7909
|
-
jobs_to_trigger?: {
|
|
7910
|
-
/** @description Specify this to run an encoding job after documents are processed. Supports chunk field encoding, encoding many fields, and storing results in a new field specified by alias. */
|
|
7911
|
-
encode?: {
|
|
7912
|
-
/** @description Chunk field to encode. Will produce a field with _chunkvector_ suffix. */
|
|
7913
|
-
chunk_field?: string;
|
|
7914
|
-
/** @description Regular fields to encode. Will produce a field with _vector suffix. */
|
|
7915
|
-
fields?: string[];
|
|
7916
|
-
/** @description If provided, this string will be added to the output field name. */
|
|
7917
|
-
alias?: string;
|
|
7918
|
-
/** @description Model name to use for encoding. */
|
|
7919
|
-
model_name?: string;
|
|
7966
|
+
}[];
|
|
7967
|
+
/** @description A list of jobs to run once all documents are processed. */
|
|
7968
|
+
jobs_to_trigger?: {
|
|
7969
|
+
/** @description Specify this to run an encoding job after documents are processed. Supports chunk field encoding, encoding many fields, and storing results in a new field specified by alias. */
|
|
7970
|
+
encode?: {
|
|
7971
|
+
/** @description Chunk field to encode. Will produce a field with _chunkvector_ suffix. */
|
|
7972
|
+
chunk_field?: string;
|
|
7973
|
+
/** @description Regular fields to encode. Will produce a field with _vector suffix. */
|
|
7974
|
+
fields?: string[];
|
|
7975
|
+
/** @description If provided, this string will be added to the output field name. */
|
|
7976
|
+
alias?: string;
|
|
7977
|
+
/** @description Model name to use for encoding. */
|
|
7978
|
+
model_name?: string;
|
|
7979
|
+
};
|
|
7980
|
+
}[];
|
|
7981
|
+
};
|
|
7982
|
+
UpdateOutput: {
|
|
7983
|
+
/** @description Completion status. */
|
|
7984
|
+
status: string;
|
|
7985
|
+
/** @description Response message for completion state. */
|
|
7986
|
+
message: string;
|
|
7987
|
+
};
|
|
7988
|
+
DeleteDocumentFieldsInput: {
|
|
7989
|
+
/** @description _id of document to delete fields of. */
|
|
7990
|
+
id: string;
|
|
7991
|
+
/** @description List of fields to delete in a document */
|
|
7992
|
+
fields: string[];
|
|
7993
|
+
};
|
|
7994
|
+
DeleteDocumentFieldsOutput: unknown;
|
|
7995
|
+
BulkUpdateInput: {
|
|
7996
|
+
/** @description List of updates to apply to documents. Each update item must contain an _id. */
|
|
7997
|
+
updates: ({
|
|
7998
|
+
_id?: unknown;
|
|
7999
|
+
} & {
|
|
8000
|
+
[key: string]: unknown;
|
|
8001
|
+
})[];
|
|
8002
|
+
/** @description Return immediately after storing data in a spot where it can be ingested in the background. Best for large datasets. */
|
|
8003
|
+
ingest_in_background?: boolean;
|
|
8004
|
+
/**
|
|
8005
|
+
* @description Whether to include insert date as a field 'insert_date_'.
|
|
8006
|
+
* @default true
|
|
8007
|
+
*/
|
|
8008
|
+
insert_date?: boolean;
|
|
8009
|
+
/**
|
|
8010
|
+
* @description Whether to transform fields containing dates to a valid Relevance date format.
|
|
8011
|
+
* @default true
|
|
8012
|
+
*/
|
|
8013
|
+
transform_date_format?: boolean;
|
|
8014
|
+
/**
|
|
8015
|
+
* @description Whether to overwrite document if it exists.
|
|
8016
|
+
* @default true
|
|
8017
|
+
*/
|
|
8018
|
+
overwrite?: boolean;
|
|
8019
|
+
/**
|
|
8020
|
+
* @description Whether the api should check the documents for vector datatype to update the schema.
|
|
8021
|
+
* @default true
|
|
8022
|
+
*/
|
|
8023
|
+
update_schema?: boolean;
|
|
8024
|
+
/**
|
|
8025
|
+
* @description Whether to return before all documents have finished updating.
|
|
8026
|
+
* @default true
|
|
8027
|
+
*/
|
|
8028
|
+
wait_for_update?: boolean;
|
|
8029
|
+
encoders?: {
|
|
8030
|
+
/** @description The model url to use */
|
|
8031
|
+
model_url?: string;
|
|
8032
|
+
/** @description The model name to use. */
|
|
8033
|
+
model_name?: "image_text" | "text_image" | "all-mpnet-base-v2" | "clip-vit-b-32-image" | "clip-vit-b-32-text" | "clip-vit-l-14-image" | "clip-vit-l-14-text" | "sentence-transformers" | "similarity-all-mpnet-base-v2";
|
|
8034
|
+
/** @description Can be 'url' or 'text'. Use 'url' for image models and 'text' for text models. */
|
|
8035
|
+
body?: string;
|
|
8036
|
+
/** @description The document field to encode. */
|
|
8037
|
+
field: string;
|
|
8038
|
+
/** @description Add 'alias' to a created vector field name. Output format is {field}_{alias}_vector_. */
|
|
8039
|
+
alias?: string;
|
|
8040
|
+
}[];
|
|
8041
|
+
/** @description Before insertion, fields of documents will be transformed according to this array of rules. If transformation fails, the output field will not be generated. */
|
|
8042
|
+
field_transformers?: {
|
|
8043
|
+
/** @description Field to transform. to transform a nested field, use a.b */
|
|
8044
|
+
field: string;
|
|
8045
|
+
/** @description If specified, place result in this field. To place in a nested field, use format a.b */
|
|
8046
|
+
output_field?: string;
|
|
8047
|
+
/** @description Whether to strip html tags from field. */
|
|
8048
|
+
remove_html?: boolean;
|
|
8049
|
+
/** @description Whether transform a text field into an array of text by splitting sentences. */
|
|
8050
|
+
split_sentences?: boolean;
|
|
8051
|
+
/** @description If specified, documents with the vector fields will be clustered according to the clustering alias */
|
|
8052
|
+
assign_to_cluster?: {
|
|
8053
|
+
/** @description The alias of the clustering. */
|
|
8054
|
+
alias?: string;
|
|
8055
|
+
};
|
|
8056
|
+
}[];
|
|
8057
|
+
/** @description A list of jobs to run once all documents are processed. */
|
|
8058
|
+
jobs_to_trigger?: {
|
|
8059
|
+
/** @description Specify this to run an encoding job after documents are processed. Supports chunk field encoding, encoding many fields, and storing results in a new field specified by alias. */
|
|
8060
|
+
encode?: {
|
|
8061
|
+
/** @description Chunk field to encode. Will produce a field with _chunkvector_ suffix. */
|
|
8062
|
+
chunk_field?: string;
|
|
8063
|
+
/** @description Regular fields to encode. Will produce a field with _vector suffix. */
|
|
8064
|
+
fields?: string[];
|
|
8065
|
+
/** @description If provided, this string will be added to the output field name. */
|
|
8066
|
+
alias?: string;
|
|
8067
|
+
/** @description Model name to use for encoding. */
|
|
8068
|
+
model_name?: string;
|
|
8069
|
+
};
|
|
8070
|
+
}[];
|
|
8071
|
+
};
|
|
8072
|
+
BulkUpdateOutput: {
|
|
8073
|
+
/** @description Number of successfully processed documents. */
|
|
8074
|
+
inserted: number;
|
|
8075
|
+
/** @description Information about documents that were not processed successfully. */
|
|
8076
|
+
failed_documents: {
|
|
8077
|
+
/** @description _id field of unprocessed document. */
|
|
8078
|
+
_id?: unknown;
|
|
8079
|
+
error?: {
|
|
8080
|
+
/** @description http status code of individual document insertion operation. */
|
|
8081
|
+
status?: number;
|
|
8082
|
+
/** @description body response of individual document insertion operation. */
|
|
8083
|
+
body?: string;
|
|
8084
|
+
};
|
|
8085
|
+
}[];
|
|
8086
|
+
};
|
|
8087
|
+
UpdateWhereInput: {
|
|
8088
|
+
filters?: (Partial<{
|
|
8089
|
+
/** @description Match where document[field] is in value list. */
|
|
8090
|
+
match?: {
|
|
8091
|
+
/** @description If matching on text, match even if there are extra words / case insensitivity */
|
|
8092
|
+
fuzzy?: boolean;
|
|
8093
|
+
/** @description Field to match on. */
|
|
8094
|
+
field?: string;
|
|
8095
|
+
/** @description Can be either a single item or a list of items to match on. */
|
|
8096
|
+
value: string | boolean | number | unknown[];
|
|
8097
|
+
};
|
|
8098
|
+
/** @description Match where document._id is in value list. */
|
|
8099
|
+
matchIds?: {
|
|
8100
|
+
/** @description Can be either a single item or a list of items to match on. */
|
|
8101
|
+
value: string | boolean | number | unknown[];
|
|
8102
|
+
};
|
|
8103
|
+
/** @description Match documents where greaterThan < document[field] < lessThan. Supports numbers and date strings. */
|
|
8104
|
+
range?: {
|
|
8105
|
+
/** @description Field to match on. */
|
|
8106
|
+
field?: string;
|
|
8107
|
+
greaterThan?: unknown;
|
|
8108
|
+
lessThan?: unknown;
|
|
8109
|
+
greaterThanOrEqualTo?: unknown;
|
|
8110
|
+
lessThanOrEqualTo?: unknown;
|
|
8111
|
+
};
|
|
8112
|
+
/**
|
|
8113
|
+
* @description
|
|
8114
|
+
* Match documents where the field either contains the value as a substring, or matches a provided matching pattern.
|
|
8115
|
+
*
|
|
8116
|
+
* Possible matching patterns:
|
|
8117
|
+
*
|
|
8118
|
+
* * - documents where the field has any value
|
|
8119
|
+
* ? - documents where a single character from the field matches the provided values
|
|
8120
|
+
*
|
|
8121
|
+
* Example:
|
|
8122
|
+
*
|
|
8123
|
+
* {
|
|
8124
|
+
* wildcard: {
|
|
8125
|
+
* field: "title",
|
|
8126
|
+
* value: [ "Avenger*" ]
|
|
8127
|
+
* }
|
|
8128
|
+
* }
|
|
8129
|
+
*/
|
|
8130
|
+
wildcard?: {
|
|
8131
|
+
/** @description Field to match on. */
|
|
8132
|
+
field?: string;
|
|
8133
|
+
/** @description single string or array of valid wildcard strings to match on, for example ['tele*'] */
|
|
8134
|
+
value: string | string[];
|
|
8135
|
+
};
|
|
8136
|
+
/** @description hybrid search query that must reach a certain value to filter */
|
|
8137
|
+
search?: {
|
|
8138
|
+
/**
|
|
8139
|
+
* @description Search for documents that contain this query string in your dataset. Use fieldsToSearch parameter to restrict which fields are searched.
|
|
8140
|
+
*
|
|
8141
|
+
* "tele" matches "Television", "This television is an excellent product…"
|
|
8142
|
+
*
|
|
8143
|
+
* Example: "tele"
|
|
8144
|
+
*/
|
|
8145
|
+
query?: string;
|
|
8146
|
+
/** @description Configuration for traditional search query. */
|
|
8147
|
+
queryConfig?: {
|
|
8148
|
+
/**
|
|
8149
|
+
* @description Increases or decreases the impact of all traditional search matching when calculating a documents _relevance.
|
|
8150
|
+
* @default 1
|
|
8151
|
+
*/
|
|
8152
|
+
weight?: number;
|
|
8153
|
+
/**
|
|
8154
|
+
* @description Increases or decreases the impact of sentence matching when calculating a documents _relevance.
|
|
8155
|
+
* For example, with query "A fox jumped", with high sentence weight, 'A fox jumped over the' would match before 'jumped a fox over fox'
|
|
8156
|
+
* @default 1
|
|
8157
|
+
*/
|
|
8158
|
+
sentenceWeight?: number;
|
|
8159
|
+
/**
|
|
8160
|
+
* @description Increases or decreases the impact of fuzzy matching when calculating a documents _relevance.
|
|
8161
|
+
* For example, with query "rain", with 0 fuzzy weight, 'brain' would not match.
|
|
8162
|
+
* @default 1
|
|
8163
|
+
*/
|
|
8164
|
+
fuzzyWeight?: number;
|
|
8165
|
+
};
|
|
8166
|
+
/**
|
|
8167
|
+
* @description Prioritise the result list of documents based on semantic similarity to "query" provided here.
|
|
8168
|
+
*
|
|
8169
|
+
* For example if field "animaltype_vector_" contains encoded vector values for "cat", lion, "dog","bird", and "query" is set to "kitten", documents with "cat", "lion" will be returned first in the results list.
|
|
8170
|
+
*
|
|
8171
|
+
* It can be an object or a list of objects.
|
|
8172
|
+
*
|
|
8173
|
+
*
|
|
8174
|
+
*
|
|
8175
|
+
* Example payloads:
|
|
8176
|
+
*
|
|
8177
|
+
* {"field":"animaltype_vector_","query":"kitten"}
|
|
8178
|
+
*
|
|
8179
|
+
* [
|
|
8180
|
+
*
|
|
8181
|
+
* {"field":"animaltype_vector_","query":"kitten","weight":1","model":"text"}, {"field":"animaltype_vector_","query":"https://www.dogimage.com/dogimage.png","model":"image","weight":2}
|
|
8182
|
+
*
|
|
8183
|
+
* ]
|
|
8184
|
+
*/
|
|
8185
|
+
vectorSearchQuery?: {
|
|
8186
|
+
/** @description Vector name to search on. For example, title_vector_ */
|
|
8187
|
+
field: string;
|
|
8188
|
+
/** @description Query to transform to a vector and then search with. Default to query in the root body if not provided. */
|
|
8189
|
+
query?: string;
|
|
8190
|
+
/**
|
|
8191
|
+
* @description Model name to generate the vector with.
|
|
8192
|
+
* @default text
|
|
8193
|
+
*/
|
|
8194
|
+
model?: string;
|
|
8195
|
+
/** @description Model url to use for encoding. If model and model_url are both set, model_url will override it. */
|
|
8196
|
+
model_url?: string;
|
|
8197
|
+
/**
|
|
8198
|
+
* @description Increases or decreases the impact of this vector fields match on documents relevance score.
|
|
8199
|
+
* @default 1
|
|
8200
|
+
*/
|
|
8201
|
+
weight?: number;
|
|
8202
|
+
/** @description Instead of generating a vector by vectorising the query, use the vector provided here for vector search. */
|
|
8203
|
+
vector?: number[];
|
|
8204
|
+
chunkConfig?: {
|
|
8205
|
+
chunkField: string;
|
|
8206
|
+
page?: number;
|
|
8207
|
+
pageSize?: number;
|
|
8208
|
+
};
|
|
8209
|
+
} | {
|
|
8210
|
+
/** @description Vector name to search on. For example, title_vector_ */
|
|
8211
|
+
field: string;
|
|
8212
|
+
/** @description Query to transform to a vector and then search with. Default to query in the root body if not provided. */
|
|
8213
|
+
query?: string;
|
|
8214
|
+
/**
|
|
8215
|
+
* @description Model name to generate the vector with.
|
|
8216
|
+
* @default text
|
|
8217
|
+
*/
|
|
8218
|
+
model?: string;
|
|
8219
|
+
/** @description Model url to use for encoding. If model and model_url are both set, model_url will override it. */
|
|
8220
|
+
model_url?: string;
|
|
8221
|
+
/**
|
|
8222
|
+
* @description Increases or decreases the impact of this vector fields match on documents relevance score.
|
|
8223
|
+
* @default 1
|
|
8224
|
+
*/
|
|
8225
|
+
weight?: number;
|
|
8226
|
+
/** @description Instead of generating a vector by vectorising the query, use the vector provided here for vector search. */
|
|
8227
|
+
vector?: number[];
|
|
8228
|
+
chunkConfig?: {
|
|
8229
|
+
chunkField: string;
|
|
8230
|
+
page?: number;
|
|
8231
|
+
pageSize?: number;
|
|
8232
|
+
};
|
|
8233
|
+
}[];
|
|
8234
|
+
realtimeClustering?: {
|
|
8235
|
+
/** @default 4 */
|
|
8236
|
+
nClusters?: number;
|
|
8237
|
+
/** @default kmeans-realtime-4 */
|
|
8238
|
+
alias?: string;
|
|
8239
|
+
vectorField: string;
|
|
8240
|
+
/** @default _cluster_.{vector_field}.{alias} */
|
|
8241
|
+
outputField?: string;
|
|
8242
|
+
};
|
|
8243
|
+
/**
|
|
8244
|
+
* @description A list of fields to search using the "query" parameter.
|
|
8245
|
+
*
|
|
8246
|
+
* Each item can be field name as a string, or an object with 'field' as field name and optional parameters such as field weight.
|
|
8247
|
+
*
|
|
8248
|
+
* Default behaviour is to search all fields.
|
|
8249
|
+
*
|
|
8250
|
+
* Example: ["name",{"field":"favourite_color","weight":0.2}]
|
|
8251
|
+
*/
|
|
8252
|
+
fieldsToSearch?: (string | {
|
|
8253
|
+
/** @description Field name to search. */
|
|
8254
|
+
field?: string;
|
|
8255
|
+
/**
|
|
8256
|
+
* @description Multiply the relevance contribution of a specific field when using traditional search.
|
|
8257
|
+
* @default 1
|
|
8258
|
+
*/
|
|
8259
|
+
weight?: number;
|
|
8260
|
+
/** @description Enabled text search on chunk fields. Scoring will take the max similarity of any subitem within the chunk. */
|
|
8261
|
+
chunkField?: string;
|
|
8262
|
+
})[];
|
|
8263
|
+
/**
|
|
8264
|
+
* @description Only return documents with a _relevance above this threshold.
|
|
8265
|
+
*
|
|
8266
|
+
* Example: 0.3
|
|
8267
|
+
*/
|
|
8268
|
+
minimumRelevance: number;
|
|
8269
|
+
};
|
|
8270
|
+
/** @description Match documents where field specified by 'field' exists in the document. for nested fields, use syntax: a.b.c */
|
|
8271
|
+
fieldExists?: {
|
|
8272
|
+
/** @description Field that must exist. */
|
|
8273
|
+
field?: string;
|
|
8274
|
+
};
|
|
8275
|
+
/** @description Match documents where doc[field] % module == value */
|
|
8276
|
+
matchModulo?: {
|
|
8277
|
+
/** @default _id */
|
|
8278
|
+
field?: string;
|
|
8279
|
+
modulo: number;
|
|
8280
|
+
value: number;
|
|
8281
|
+
};
|
|
8282
|
+
/** @description Filter down to one document for each value of selected field. */
|
|
8283
|
+
dedupeByValue?: {
|
|
8284
|
+
/** @description Field to filter on. */
|
|
8285
|
+
field: string;
|
|
8286
|
+
};
|
|
8287
|
+
/** @description Match documents where document[a] <=/>=/</>/==/!=/stringEquals document[b]. Use stringEquals to compare strings. */
|
|
8288
|
+
selfreference?: {
|
|
8289
|
+
/** @description First field in comparison. */
|
|
8290
|
+
a: string;
|
|
8291
|
+
/** @description Second field in comparison. */
|
|
8292
|
+
b: string;
|
|
8293
|
+
/** @description Operator used to compare a and b. */
|
|
8294
|
+
operation: "<=" | ">=" | "<" | ">" | "==" | "!=" | "stringEquals";
|
|
8295
|
+
};
|
|
8296
|
+
/** @description Match documents where greaterThan < wordCount(document[field]) < lessThan. */
|
|
8297
|
+
wordCount?: {
|
|
8298
|
+
/** @description Field to match on. */
|
|
8299
|
+
field: string;
|
|
8300
|
+
/** @description Minimum word count. */
|
|
8301
|
+
greaterThan?: number;
|
|
8302
|
+
/** @description Maximum word count. */
|
|
8303
|
+
lessThan?: number;
|
|
8304
|
+
};
|
|
8305
|
+
/** @description Match documents where greaterThan < characterCount(document[field]) < lessThan. */
|
|
8306
|
+
characterCount?: {
|
|
8307
|
+
/** @description Field to match on. */
|
|
8308
|
+
field: string;
|
|
8309
|
+
/** @description Minimum character count. */
|
|
8310
|
+
greaterThan?: number;
|
|
8311
|
+
/** @description Maximum character count. */
|
|
8312
|
+
lessThan?: number;
|
|
8313
|
+
};
|
|
8314
|
+
/** @description Used to perform a logical OR of filters. each element of the OR list can itself be a list to perform a nested AND. {or:[[A,B],C]} is equivalent to (A AND B) OR C */
|
|
8315
|
+
or?: (components["schemas"]["simpleSearchAndFlatFilterItem"][] | components["schemas"]["simpleSearchAndFlatFilterItem"])[];
|
|
8316
|
+
/** @description Used to perform NOT filter. Can be a single filter or a list of filters to perform a !(AND). {not:[A,B]} is equivalent to !(A AND B) */
|
|
8317
|
+
not?: components["schemas"]["simpleSearchAndFlatFilterItem"][] | components["schemas"]["simpleSearchAndFlatFilterItem"];
|
|
8318
|
+
/** @description Filter based on data within a _chunk_ field. */
|
|
8319
|
+
chunk?: {
|
|
8320
|
+
/** @description The path of the chunk field to filter on. For example: description_sentences_chunk_ */
|
|
8321
|
+
path: string;
|
|
8322
|
+
filters: components["schemas"]["simpleSearchAndFlatFilterItem"][];
|
|
8323
|
+
};
|
|
8324
|
+
}> & Partial<{
|
|
8325
|
+
strict?: "must" | "should" | "must_or";
|
|
8326
|
+
condition?: string;
|
|
8327
|
+
field?: string;
|
|
8328
|
+
filter_type?: "text_match" | "word_match" | "term" | "terms" | "text" | "texts" | "match" | "contains" | "substring" | "class" | "category" | "exact_match" | "classes" | "categories" | "exists" | "traditional" | "fuzzy" | "regexp" | "ids" | "date" | "numeric" | "search" | "or" | "word_count" | "character_count" | "dedupe_by_value";
|
|
8329
|
+
condition_value?: unknown;
|
|
8330
|
+
fuzzy?: number;
|
|
8331
|
+
join?: boolean;
|
|
8332
|
+
}>)[];
|
|
8333
|
+
/** @description Updates to make to the documents. It should be specified in a format of {"field_name": "value"}. e.g. {"item.status" : "Sold Out"} */
|
|
8334
|
+
updates: {
|
|
8335
|
+
[key: string]: unknown;
|
|
8336
|
+
};
|
|
8337
|
+
};
|
|
8338
|
+
UpdateWhereOutput: {
|
|
8339
|
+
/** @description Completion status. */
|
|
8340
|
+
status: string;
|
|
8341
|
+
/** @description Response message for completion state. */
|
|
8342
|
+
message: string;
|
|
8343
|
+
};
|
|
8344
|
+
AppendTagsInput: {
|
|
8345
|
+
filters?: (Partial<{
|
|
8346
|
+
/** @description Match where document[field] is in value list. */
|
|
8347
|
+
match?: {
|
|
8348
|
+
/** @description If matching on text, match even if there are extra words / case insensitivity */
|
|
8349
|
+
fuzzy?: boolean;
|
|
8350
|
+
/** @description Field to match on. */
|
|
8351
|
+
field?: string;
|
|
8352
|
+
/** @description Can be either a single item or a list of items to match on. */
|
|
8353
|
+
value: string | boolean | number | unknown[];
|
|
8354
|
+
};
|
|
8355
|
+
/** @description Match where document._id is in value list. */
|
|
8356
|
+
matchIds?: {
|
|
8357
|
+
/** @description Can be either a single item or a list of items to match on. */
|
|
8358
|
+
value: string | boolean | number | unknown[];
|
|
8359
|
+
};
|
|
8360
|
+
/** @description Match documents where greaterThan < document[field] < lessThan. Supports numbers and date strings. */
|
|
8361
|
+
range?: {
|
|
8362
|
+
/** @description Field to match on. */
|
|
8363
|
+
field?: string;
|
|
8364
|
+
greaterThan?: unknown;
|
|
8365
|
+
lessThan?: unknown;
|
|
8366
|
+
greaterThanOrEqualTo?: unknown;
|
|
8367
|
+
lessThanOrEqualTo?: unknown;
|
|
8368
|
+
};
|
|
8369
|
+
/**
|
|
8370
|
+
* @description
|
|
8371
|
+
* Match documents where the field either contains the value as a substring, or matches a provided matching pattern.
|
|
8372
|
+
*
|
|
8373
|
+
* Possible matching patterns:
|
|
8374
|
+
*
|
|
8375
|
+
* * - documents where the field has any value
|
|
8376
|
+
* ? - documents where a single character from the field matches the provided values
|
|
8377
|
+
*
|
|
8378
|
+
* Example:
|
|
8379
|
+
*
|
|
8380
|
+
* {
|
|
8381
|
+
* wildcard: {
|
|
8382
|
+
* field: "title",
|
|
8383
|
+
* value: [ "Avenger*" ]
|
|
8384
|
+
* }
|
|
8385
|
+
* }
|
|
8386
|
+
*/
|
|
8387
|
+
wildcard?: {
|
|
8388
|
+
/** @description Field to match on. */
|
|
8389
|
+
field?: string;
|
|
8390
|
+
/** @description single string or array of valid wildcard strings to match on, for example ['tele*'] */
|
|
8391
|
+
value: string | string[];
|
|
8392
|
+
};
|
|
8393
|
+
/** @description hybrid search query that must reach a certain value to filter */
|
|
8394
|
+
search?: {
|
|
8395
|
+
/**
|
|
8396
|
+
* @description Search for documents that contain this query string in your dataset. Use fieldsToSearch parameter to restrict which fields are searched.
|
|
8397
|
+
*
|
|
8398
|
+
* "tele" matches "Television", "This television is an excellent product…"
|
|
8399
|
+
*
|
|
8400
|
+
* Example: "tele"
|
|
8401
|
+
*/
|
|
8402
|
+
query?: string;
|
|
8403
|
+
/** @description Configuration for traditional search query. */
|
|
8404
|
+
queryConfig?: {
|
|
8405
|
+
/**
|
|
8406
|
+
* @description Increases or decreases the impact of all traditional search matching when calculating a documents _relevance.
|
|
8407
|
+
* @default 1
|
|
8408
|
+
*/
|
|
8409
|
+
weight?: number;
|
|
8410
|
+
/**
|
|
8411
|
+
* @description Increases or decreases the impact of sentence matching when calculating a documents _relevance.
|
|
8412
|
+
* For example, with query "A fox jumped", with high sentence weight, 'A fox jumped over the' would match before 'jumped a fox over fox'
|
|
8413
|
+
* @default 1
|
|
8414
|
+
*/
|
|
8415
|
+
sentenceWeight?: number;
|
|
8416
|
+
/**
|
|
8417
|
+
* @description Increases or decreases the impact of fuzzy matching when calculating a documents _relevance.
|
|
8418
|
+
* For example, with query "rain", with 0 fuzzy weight, 'brain' would not match.
|
|
8419
|
+
* @default 1
|
|
8420
|
+
*/
|
|
8421
|
+
fuzzyWeight?: number;
|
|
8422
|
+
};
|
|
8423
|
+
/**
|
|
8424
|
+
* @description Prioritise the result list of documents based on semantic similarity to "query" provided here.
|
|
8425
|
+
*
|
|
8426
|
+
* For example if field "animaltype_vector_" contains encoded vector values for "cat", lion, "dog","bird", and "query" is set to "kitten", documents with "cat", "lion" will be returned first in the results list.
|
|
8427
|
+
*
|
|
8428
|
+
* It can be an object or a list of objects.
|
|
8429
|
+
*
|
|
8430
|
+
*
|
|
8431
|
+
*
|
|
8432
|
+
* Example payloads:
|
|
8433
|
+
*
|
|
8434
|
+
* {"field":"animaltype_vector_","query":"kitten"}
|
|
8435
|
+
*
|
|
8436
|
+
* [
|
|
8437
|
+
*
|
|
8438
|
+
* {"field":"animaltype_vector_","query":"kitten","weight":1","model":"text"}, {"field":"animaltype_vector_","query":"https://www.dogimage.com/dogimage.png","model":"image","weight":2}
|
|
8439
|
+
*
|
|
8440
|
+
* ]
|
|
8441
|
+
*/
|
|
8442
|
+
vectorSearchQuery?: {
|
|
8443
|
+
/** @description Vector name to search on. For example, title_vector_ */
|
|
8444
|
+
field: string;
|
|
8445
|
+
/** @description Query to transform to a vector and then search with. Default to query in the root body if not provided. */
|
|
8446
|
+
query?: string;
|
|
8447
|
+
/**
|
|
8448
|
+
* @description Model name to generate the vector with.
|
|
8449
|
+
* @default text
|
|
8450
|
+
*/
|
|
8451
|
+
model?: string;
|
|
8452
|
+
/** @description Model url to use for encoding. If model and model_url are both set, model_url will override it. */
|
|
8453
|
+
model_url?: string;
|
|
8454
|
+
/**
|
|
8455
|
+
* @description Increases or decreases the impact of this vector fields match on documents relevance score.
|
|
8456
|
+
* @default 1
|
|
8457
|
+
*/
|
|
8458
|
+
weight?: number;
|
|
8459
|
+
/** @description Instead of generating a vector by vectorising the query, use the vector provided here for vector search. */
|
|
8460
|
+
vector?: number[];
|
|
8461
|
+
chunkConfig?: {
|
|
8462
|
+
chunkField: string;
|
|
8463
|
+
page?: number;
|
|
8464
|
+
pageSize?: number;
|
|
8465
|
+
};
|
|
8466
|
+
} | {
|
|
8467
|
+
/** @description Vector name to search on. For example, title_vector_ */
|
|
8468
|
+
field: string;
|
|
8469
|
+
/** @description Query to transform to a vector and then search with. Default to query in the root body if not provided. */
|
|
8470
|
+
query?: string;
|
|
8471
|
+
/**
|
|
8472
|
+
* @description Model name to generate the vector with.
|
|
8473
|
+
* @default text
|
|
8474
|
+
*/
|
|
8475
|
+
model?: string;
|
|
8476
|
+
/** @description Model url to use for encoding. If model and model_url are both set, model_url will override it. */
|
|
8477
|
+
model_url?: string;
|
|
8478
|
+
/**
|
|
8479
|
+
* @description Increases or decreases the impact of this vector fields match on documents relevance score.
|
|
8480
|
+
* @default 1
|
|
8481
|
+
*/
|
|
8482
|
+
weight?: number;
|
|
8483
|
+
/** @description Instead of generating a vector by vectorising the query, use the vector provided here for vector search. */
|
|
8484
|
+
vector?: number[];
|
|
8485
|
+
chunkConfig?: {
|
|
8486
|
+
chunkField: string;
|
|
8487
|
+
page?: number;
|
|
8488
|
+
pageSize?: number;
|
|
8489
|
+
};
|
|
8490
|
+
}[];
|
|
8491
|
+
realtimeClustering?: {
|
|
8492
|
+
/** @default 4 */
|
|
8493
|
+
nClusters?: number;
|
|
8494
|
+
/** @default kmeans-realtime-4 */
|
|
8495
|
+
alias?: string;
|
|
8496
|
+
vectorField: string;
|
|
8497
|
+
/** @default _cluster_.{vector_field}.{alias} */
|
|
8498
|
+
outputField?: string;
|
|
8499
|
+
};
|
|
8500
|
+
/**
|
|
8501
|
+
* @description A list of fields to search using the "query" parameter.
|
|
8502
|
+
*
|
|
8503
|
+
* Each item can be field name as a string, or an object with 'field' as field name and optional parameters such as field weight.
|
|
8504
|
+
*
|
|
8505
|
+
* Default behaviour is to search all fields.
|
|
8506
|
+
*
|
|
8507
|
+
* Example: ["name",{"field":"favourite_color","weight":0.2}]
|
|
8508
|
+
*/
|
|
8509
|
+
fieldsToSearch?: (string | {
|
|
8510
|
+
/** @description Field name to search. */
|
|
8511
|
+
field?: string;
|
|
8512
|
+
/**
|
|
8513
|
+
* @description Multiply the relevance contribution of a specific field when using traditional search.
|
|
8514
|
+
* @default 1
|
|
8515
|
+
*/
|
|
8516
|
+
weight?: number;
|
|
8517
|
+
/** @description Enabled text search on chunk fields. Scoring will take the max similarity of any subitem within the chunk. */
|
|
8518
|
+
chunkField?: string;
|
|
8519
|
+
})[];
|
|
8520
|
+
/**
|
|
8521
|
+
* @description Only return documents with a _relevance above this threshold.
|
|
8522
|
+
*
|
|
8523
|
+
* Example: 0.3
|
|
8524
|
+
*/
|
|
8525
|
+
minimumRelevance: number;
|
|
8526
|
+
};
|
|
8527
|
+
/** @description Match documents where field specified by 'field' exists in the document. for nested fields, use syntax: a.b.c */
|
|
8528
|
+
fieldExists?: {
|
|
8529
|
+
/** @description Field that must exist. */
|
|
8530
|
+
field?: string;
|
|
8531
|
+
};
|
|
8532
|
+
/** @description Match documents where doc[field] % module == value */
|
|
8533
|
+
matchModulo?: {
|
|
8534
|
+
/** @default _id */
|
|
8535
|
+
field?: string;
|
|
8536
|
+
modulo: number;
|
|
8537
|
+
value: number;
|
|
8538
|
+
};
|
|
8539
|
+
/** @description Filter down to one document for each value of selected field. */
|
|
8540
|
+
dedupeByValue?: {
|
|
8541
|
+
/** @description Field to filter on. */
|
|
8542
|
+
field: string;
|
|
8543
|
+
};
|
|
8544
|
+
/** @description Match documents where document[a] <=/>=/</>/==/!=/stringEquals document[b]. Use stringEquals to compare strings. */
|
|
8545
|
+
selfreference?: {
|
|
8546
|
+
/** @description First field in comparison. */
|
|
8547
|
+
a: string;
|
|
8548
|
+
/** @description Second field in comparison. */
|
|
8549
|
+
b: string;
|
|
8550
|
+
/** @description Operator used to compare a and b. */
|
|
8551
|
+
operation: "<=" | ">=" | "<" | ">" | "==" | "!=" | "stringEquals";
|
|
8552
|
+
};
|
|
8553
|
+
/** @description Match documents where greaterThan < wordCount(document[field]) < lessThan. */
|
|
8554
|
+
wordCount?: {
|
|
8555
|
+
/** @description Field to match on. */
|
|
8556
|
+
field: string;
|
|
8557
|
+
/** @description Minimum word count. */
|
|
8558
|
+
greaterThan?: number;
|
|
8559
|
+
/** @description Maximum word count. */
|
|
8560
|
+
lessThan?: number;
|
|
8561
|
+
};
|
|
8562
|
+
/** @description Match documents where greaterThan < characterCount(document[field]) < lessThan. */
|
|
8563
|
+
characterCount?: {
|
|
8564
|
+
/** @description Field to match on. */
|
|
8565
|
+
field: string;
|
|
8566
|
+
/** @description Minimum character count. */
|
|
8567
|
+
greaterThan?: number;
|
|
8568
|
+
/** @description Maximum character count. */
|
|
8569
|
+
lessThan?: number;
|
|
8570
|
+
};
|
|
8571
|
+
/** @description Used to perform a logical OR of filters. each element of the OR list can itself be a list to perform a nested AND. {or:[[A,B],C]} is equivalent to (A AND B) OR C */
|
|
8572
|
+
or?: (components["schemas"]["simpleSearchAndFlatFilterItem"][] | components["schemas"]["simpleSearchAndFlatFilterItem"])[];
|
|
8573
|
+
/** @description Used to perform NOT filter. Can be a single filter or a list of filters to perform a !(AND). {not:[A,B]} is equivalent to !(A AND B) */
|
|
8574
|
+
not?: components["schemas"]["simpleSearchAndFlatFilterItem"][] | components["schemas"]["simpleSearchAndFlatFilterItem"];
|
|
8575
|
+
/** @description Filter based on data within a _chunk_ field. */
|
|
8576
|
+
chunk?: {
|
|
8577
|
+
/** @description The path of the chunk field to filter on. For example: description_sentences_chunk_ */
|
|
8578
|
+
path: string;
|
|
8579
|
+
filters: components["schemas"]["simpleSearchAndFlatFilterItem"][];
|
|
8580
|
+
};
|
|
8581
|
+
}> & Partial<{
|
|
8582
|
+
strict?: "must" | "should" | "must_or";
|
|
8583
|
+
condition?: string;
|
|
8584
|
+
field?: string;
|
|
8585
|
+
filter_type?: "text_match" | "word_match" | "term" | "terms" | "text" | "texts" | "match" | "contains" | "substring" | "class" | "category" | "exact_match" | "classes" | "categories" | "exists" | "traditional" | "fuzzy" | "regexp" | "ids" | "date" | "numeric" | "search" | "or" | "word_count" | "character_count" | "dedupe_by_value";
|
|
8586
|
+
condition_value?: unknown;
|
|
8587
|
+
fuzzy?: number;
|
|
8588
|
+
join?: boolean;
|
|
8589
|
+
}>)[];
|
|
8590
|
+
field: string;
|
|
8591
|
+
tags_to_add: string[];
|
|
8592
|
+
};
|
|
8593
|
+
AppendTagsOutput: unknown;
|
|
8594
|
+
DeleteTagsInput: {
|
|
8595
|
+
filters?: (Partial<{
|
|
8596
|
+
/** @description Match where document[field] is in value list. */
|
|
8597
|
+
match?: {
|
|
8598
|
+
/** @description If matching on text, match even if there are extra words / case insensitivity */
|
|
8599
|
+
fuzzy?: boolean;
|
|
8600
|
+
/** @description Field to match on. */
|
|
8601
|
+
field?: string;
|
|
8602
|
+
/** @description Can be either a single item or a list of items to match on. */
|
|
8603
|
+
value: string | boolean | number | unknown[];
|
|
8604
|
+
};
|
|
8605
|
+
/** @description Match where document._id is in value list. */
|
|
8606
|
+
matchIds?: {
|
|
8607
|
+
/** @description Can be either a single item or a list of items to match on. */
|
|
8608
|
+
value: string | boolean | number | unknown[];
|
|
8609
|
+
};
|
|
8610
|
+
/** @description Match documents where greaterThan < document[field] < lessThan. Supports numbers and date strings. */
|
|
8611
|
+
range?: {
|
|
8612
|
+
/** @description Field to match on. */
|
|
8613
|
+
field?: string;
|
|
8614
|
+
greaterThan?: unknown;
|
|
8615
|
+
lessThan?: unknown;
|
|
8616
|
+
greaterThanOrEqualTo?: unknown;
|
|
8617
|
+
lessThanOrEqualTo?: unknown;
|
|
8618
|
+
};
|
|
8619
|
+
/**
|
|
8620
|
+
* @description
|
|
8621
|
+
* Match documents where the field either contains the value as a substring, or matches a provided matching pattern.
|
|
8622
|
+
*
|
|
8623
|
+
* Possible matching patterns:
|
|
8624
|
+
*
|
|
8625
|
+
* * - documents where the field has any value
|
|
8626
|
+
* ? - documents where a single character from the field matches the provided values
|
|
8627
|
+
*
|
|
8628
|
+
* Example:
|
|
8629
|
+
*
|
|
8630
|
+
* {
|
|
8631
|
+
* wildcard: {
|
|
8632
|
+
* field: "title",
|
|
8633
|
+
* value: [ "Avenger*" ]
|
|
8634
|
+
* }
|
|
8635
|
+
* }
|
|
8636
|
+
*/
|
|
8637
|
+
wildcard?: {
|
|
8638
|
+
/** @description Field to match on. */
|
|
8639
|
+
field?: string;
|
|
8640
|
+
/** @description single string or array of valid wildcard strings to match on, for example ['tele*'] */
|
|
8641
|
+
value: string | string[];
|
|
8642
|
+
};
|
|
8643
|
+
/** @description hybrid search query that must reach a certain value to filter */
|
|
8644
|
+
search?: {
|
|
8645
|
+
/**
|
|
8646
|
+
* @description Search for documents that contain this query string in your dataset. Use fieldsToSearch parameter to restrict which fields are searched.
|
|
8647
|
+
*
|
|
8648
|
+
* "tele" matches "Television", "This television is an excellent product…"
|
|
8649
|
+
*
|
|
8650
|
+
* Example: "tele"
|
|
8651
|
+
*/
|
|
8652
|
+
query?: string;
|
|
8653
|
+
/** @description Configuration for traditional search query. */
|
|
8654
|
+
queryConfig?: {
|
|
8655
|
+
/**
|
|
8656
|
+
* @description Increases or decreases the impact of all traditional search matching when calculating a documents _relevance.
|
|
8657
|
+
* @default 1
|
|
8658
|
+
*/
|
|
8659
|
+
weight?: number;
|
|
8660
|
+
/**
|
|
8661
|
+
* @description Increases or decreases the impact of sentence matching when calculating a documents _relevance.
|
|
8662
|
+
* For example, with query "A fox jumped", with high sentence weight, 'A fox jumped over the' would match before 'jumped a fox over fox'
|
|
8663
|
+
* @default 1
|
|
8664
|
+
*/
|
|
8665
|
+
sentenceWeight?: number;
|
|
8666
|
+
/**
|
|
8667
|
+
* @description Increases or decreases the impact of fuzzy matching when calculating a documents _relevance.
|
|
8668
|
+
* For example, with query "rain", with 0 fuzzy weight, 'brain' would not match.
|
|
8669
|
+
* @default 1
|
|
8670
|
+
*/
|
|
8671
|
+
fuzzyWeight?: number;
|
|
8672
|
+
};
|
|
8673
|
+
/**
|
|
8674
|
+
* @description Prioritise the result list of documents based on semantic similarity to "query" provided here.
|
|
8675
|
+
*
|
|
8676
|
+
* For example if field "animaltype_vector_" contains encoded vector values for "cat", lion, "dog","bird", and "query" is set to "kitten", documents with "cat", "lion" will be returned first in the results list.
|
|
8677
|
+
*
|
|
8678
|
+
* It can be an object or a list of objects.
|
|
8679
|
+
*
|
|
8680
|
+
*
|
|
8681
|
+
*
|
|
8682
|
+
* Example payloads:
|
|
8683
|
+
*
|
|
8684
|
+
* {"field":"animaltype_vector_","query":"kitten"}
|
|
8685
|
+
*
|
|
8686
|
+
* [
|
|
8687
|
+
*
|
|
8688
|
+
* {"field":"animaltype_vector_","query":"kitten","weight":1","model":"text"}, {"field":"animaltype_vector_","query":"https://www.dogimage.com/dogimage.png","model":"image","weight":2}
|
|
8689
|
+
*
|
|
8690
|
+
* ]
|
|
8691
|
+
*/
|
|
8692
|
+
vectorSearchQuery?: {
|
|
8693
|
+
/** @description Vector name to search on. For example, title_vector_ */
|
|
8694
|
+
field: string;
|
|
8695
|
+
/** @description Query to transform to a vector and then search with. Default to query in the root body if not provided. */
|
|
8696
|
+
query?: string;
|
|
8697
|
+
/**
|
|
8698
|
+
* @description Model name to generate the vector with.
|
|
8699
|
+
* @default text
|
|
8700
|
+
*/
|
|
8701
|
+
model?: string;
|
|
8702
|
+
/** @description Model url to use for encoding. If model and model_url are both set, model_url will override it. */
|
|
8703
|
+
model_url?: string;
|
|
8704
|
+
/**
|
|
8705
|
+
* @description Increases or decreases the impact of this vector fields match on documents relevance score.
|
|
8706
|
+
* @default 1
|
|
8707
|
+
*/
|
|
8708
|
+
weight?: number;
|
|
8709
|
+
/** @description Instead of generating a vector by vectorising the query, use the vector provided here for vector search. */
|
|
8710
|
+
vector?: number[];
|
|
8711
|
+
chunkConfig?: {
|
|
8712
|
+
chunkField: string;
|
|
8713
|
+
page?: number;
|
|
8714
|
+
pageSize?: number;
|
|
8715
|
+
};
|
|
8716
|
+
} | {
|
|
8717
|
+
/** @description Vector name to search on. For example, title_vector_ */
|
|
8718
|
+
field: string;
|
|
8719
|
+
/** @description Query to transform to a vector and then search with. Default to query in the root body if not provided. */
|
|
8720
|
+
query?: string;
|
|
8721
|
+
/**
|
|
8722
|
+
* @description Model name to generate the vector with.
|
|
8723
|
+
* @default text
|
|
8724
|
+
*/
|
|
8725
|
+
model?: string;
|
|
8726
|
+
/** @description Model url to use for encoding. If model and model_url are both set, model_url will override it. */
|
|
8727
|
+
model_url?: string;
|
|
8728
|
+
/**
|
|
8729
|
+
* @description Increases or decreases the impact of this vector fields match on documents relevance score.
|
|
8730
|
+
* @default 1
|
|
8731
|
+
*/
|
|
8732
|
+
weight?: number;
|
|
8733
|
+
/** @description Instead of generating a vector by vectorising the query, use the vector provided here for vector search. */
|
|
8734
|
+
vector?: number[];
|
|
8735
|
+
chunkConfig?: {
|
|
8736
|
+
chunkField: string;
|
|
8737
|
+
page?: number;
|
|
8738
|
+
pageSize?: number;
|
|
8739
|
+
};
|
|
8740
|
+
}[];
|
|
8741
|
+
realtimeClustering?: {
|
|
8742
|
+
/** @default 4 */
|
|
8743
|
+
nClusters?: number;
|
|
8744
|
+
/** @default kmeans-realtime-4 */
|
|
8745
|
+
alias?: string;
|
|
8746
|
+
vectorField: string;
|
|
8747
|
+
/** @default _cluster_.{vector_field}.{alias} */
|
|
8748
|
+
outputField?: string;
|
|
8749
|
+
};
|
|
8750
|
+
/**
|
|
8751
|
+
* @description A list of fields to search using the "query" parameter.
|
|
8752
|
+
*
|
|
8753
|
+
* Each item can be field name as a string, or an object with 'field' as field name and optional parameters such as field weight.
|
|
8754
|
+
*
|
|
8755
|
+
* Default behaviour is to search all fields.
|
|
8756
|
+
*
|
|
8757
|
+
* Example: ["name",{"field":"favourite_color","weight":0.2}]
|
|
8758
|
+
*/
|
|
8759
|
+
fieldsToSearch?: (string | {
|
|
8760
|
+
/** @description Field name to search. */
|
|
8761
|
+
field?: string;
|
|
8762
|
+
/**
|
|
8763
|
+
* @description Multiply the relevance contribution of a specific field when using traditional search.
|
|
8764
|
+
* @default 1
|
|
8765
|
+
*/
|
|
8766
|
+
weight?: number;
|
|
8767
|
+
/** @description Enabled text search on chunk fields. Scoring will take the max similarity of any subitem within the chunk. */
|
|
8768
|
+
chunkField?: string;
|
|
8769
|
+
})[];
|
|
8770
|
+
/**
|
|
8771
|
+
* @description Only return documents with a _relevance above this threshold.
|
|
8772
|
+
*
|
|
8773
|
+
* Example: 0.3
|
|
8774
|
+
*/
|
|
8775
|
+
minimumRelevance: number;
|
|
8776
|
+
};
|
|
8777
|
+
/** @description Match documents where field specified by 'field' exists in the document. for nested fields, use syntax: a.b.c */
|
|
8778
|
+
fieldExists?: {
|
|
8779
|
+
/** @description Field that must exist. */
|
|
8780
|
+
field?: string;
|
|
7920
8781
|
};
|
|
7921
|
-
|
|
7922
|
-
|
|
7923
|
-
|
|
7924
|
-
|
|
7925
|
-
|
|
7926
|
-
|
|
7927
|
-
message: string;
|
|
7928
|
-
};
|
|
7929
|
-
DeleteDocumentFieldsInput: {
|
|
7930
|
-
/** @description _id of document to delete fields of. */
|
|
7931
|
-
id: string;
|
|
7932
|
-
/** @description List of fields to delete in a document */
|
|
7933
|
-
fields: string[];
|
|
7934
|
-
};
|
|
7935
|
-
DeleteDocumentFieldsOutput: unknown;
|
|
7936
|
-
BulkUpdateInput: {
|
|
7937
|
-
/** @description List of updates to apply to documents. Each update item must contain an _id. */
|
|
7938
|
-
updates: ({
|
|
7939
|
-
_id?: unknown;
|
|
7940
|
-
} & {
|
|
7941
|
-
[key: string]: unknown;
|
|
7942
|
-
})[];
|
|
7943
|
-
/** @description Return immediately after storing data in a spot where it can be ingested in the background. Best for large datasets. */
|
|
7944
|
-
ingest_in_background?: boolean;
|
|
7945
|
-
/**
|
|
7946
|
-
* @description Whether to include insert date as a field 'insert_date_'.
|
|
7947
|
-
* @default true
|
|
7948
|
-
*/
|
|
7949
|
-
insert_date?: boolean;
|
|
7950
|
-
/**
|
|
7951
|
-
* @description Whether to transform fields containing dates to a valid Relevance date format.
|
|
7952
|
-
* @default true
|
|
7953
|
-
*/
|
|
7954
|
-
transform_date_format?: boolean;
|
|
7955
|
-
/**
|
|
7956
|
-
* @description Whether to overwrite document if it exists.
|
|
7957
|
-
* @default true
|
|
7958
|
-
*/
|
|
7959
|
-
overwrite?: boolean;
|
|
7960
|
-
/**
|
|
7961
|
-
* @description Whether the api should check the documents for vector datatype to update the schema.
|
|
7962
|
-
* @default true
|
|
7963
|
-
*/
|
|
7964
|
-
update_schema?: boolean;
|
|
7965
|
-
/**
|
|
7966
|
-
* @description Whether to return before all documents have finished updating.
|
|
7967
|
-
* @default true
|
|
7968
|
-
*/
|
|
7969
|
-
wait_for_update?: boolean;
|
|
7970
|
-
encoders?: {
|
|
7971
|
-
/** @description The model url to use */
|
|
7972
|
-
model_url?: string;
|
|
7973
|
-
/** @description The model name to use. */
|
|
7974
|
-
model_name?: "image_text" | "text_image" | "all-mpnet-base-v2" | "clip-vit-b-32-image" | "clip-vit-b-32-text" | "clip-vit-l-14-image" | "clip-vit-l-14-text" | "sentence-transformers" | "similarity-all-mpnet-base-v2";
|
|
7975
|
-
/** @description Can be 'url' or 'text'. Use 'url' for image models and 'text' for text models. */
|
|
7976
|
-
body?: string;
|
|
7977
|
-
/** @description The document field to encode. */
|
|
7978
|
-
field: string;
|
|
7979
|
-
/** @description Add 'alias' to a created vector field name. Output format is {field}_{alias}_vector_. */
|
|
7980
|
-
alias?: string;
|
|
7981
|
-
}[];
|
|
7982
|
-
/** @description Before insertion, fields of documents will be transformed according to this array of rules. If transformation fails, the output field will not be generated. */
|
|
7983
|
-
field_transformers?: {
|
|
7984
|
-
/** @description Field to transform. to transform a nested field, use a.b */
|
|
7985
|
-
field: string;
|
|
7986
|
-
/** @description If specified, place result in this field. To place in a nested field, use format a.b */
|
|
7987
|
-
output_field?: string;
|
|
7988
|
-
/** @description Whether to strip html tags from field. */
|
|
7989
|
-
remove_html?: boolean;
|
|
7990
|
-
/** @description Whether transform a text field into an array of text by splitting sentences. */
|
|
7991
|
-
split_sentences?: boolean;
|
|
7992
|
-
/** @description If specified, documents with the vector fields will be clustered according to the clustering alias */
|
|
7993
|
-
assign_to_cluster?: {
|
|
7994
|
-
/** @description The alias of the clustering. */
|
|
7995
|
-
alias?: string;
|
|
8782
|
+
/** @description Match documents where doc[field] % module == value */
|
|
8783
|
+
matchModulo?: {
|
|
8784
|
+
/** @default _id */
|
|
8785
|
+
field?: string;
|
|
8786
|
+
modulo: number;
|
|
8787
|
+
value: number;
|
|
7996
8788
|
};
|
|
7997
|
-
|
|
7998
|
-
|
|
7999
|
-
|
|
8000
|
-
|
|
8001
|
-
encode?: {
|
|
8002
|
-
/** @description Chunk field to encode. Will produce a field with _chunkvector_ suffix. */
|
|
8003
|
-
chunk_field?: string;
|
|
8004
|
-
/** @description Regular fields to encode. Will produce a field with _vector suffix. */
|
|
8005
|
-
fields?: string[];
|
|
8006
|
-
/** @description If provided, this string will be added to the output field name. */
|
|
8007
|
-
alias?: string;
|
|
8008
|
-
/** @description Model name to use for encoding. */
|
|
8009
|
-
model_name?: string;
|
|
8789
|
+
/** @description Filter down to one document for each value of selected field. */
|
|
8790
|
+
dedupeByValue?: {
|
|
8791
|
+
/** @description Field to filter on. */
|
|
8792
|
+
field: string;
|
|
8010
8793
|
};
|
|
8011
|
-
|
|
8012
|
-
|
|
8013
|
-
|
|
8014
|
-
|
|
8015
|
-
|
|
8016
|
-
|
|
8017
|
-
|
|
8018
|
-
|
|
8019
|
-
_id?: unknown;
|
|
8020
|
-
error?: {
|
|
8021
|
-
/** @description http status code of individual document insertion operation. */
|
|
8022
|
-
status?: number;
|
|
8023
|
-
/** @description body response of individual document insertion operation. */
|
|
8024
|
-
body?: string;
|
|
8794
|
+
/** @description Match documents where document[a] <=/>=/</>/==/!=/stringEquals document[b]. Use stringEquals to compare strings. */
|
|
8795
|
+
selfreference?: {
|
|
8796
|
+
/** @description First field in comparison. */
|
|
8797
|
+
a: string;
|
|
8798
|
+
/** @description Second field in comparison. */
|
|
8799
|
+
b: string;
|
|
8800
|
+
/** @description Operator used to compare a and b. */
|
|
8801
|
+
operation: "<=" | ">=" | "<" | ">" | "==" | "!=" | "stringEquals";
|
|
8025
8802
|
};
|
|
8026
|
-
|
|
8803
|
+
/** @description Match documents where greaterThan < wordCount(document[field]) < lessThan. */
|
|
8804
|
+
wordCount?: {
|
|
8805
|
+
/** @description Field to match on. */
|
|
8806
|
+
field: string;
|
|
8807
|
+
/** @description Minimum word count. */
|
|
8808
|
+
greaterThan?: number;
|
|
8809
|
+
/** @description Maximum word count. */
|
|
8810
|
+
lessThan?: number;
|
|
8811
|
+
};
|
|
8812
|
+
/** @description Match documents where greaterThan < characterCount(document[field]) < lessThan. */
|
|
8813
|
+
characterCount?: {
|
|
8814
|
+
/** @description Field to match on. */
|
|
8815
|
+
field: string;
|
|
8816
|
+
/** @description Minimum character count. */
|
|
8817
|
+
greaterThan?: number;
|
|
8818
|
+
/** @description Maximum character count. */
|
|
8819
|
+
lessThan?: number;
|
|
8820
|
+
};
|
|
8821
|
+
/** @description Used to perform a logical OR of filters. each element of the OR list can itself be a list to perform a nested AND. {or:[[A,B],C]} is equivalent to (A AND B) OR C */
|
|
8822
|
+
or?: (components["schemas"]["simpleSearchAndFlatFilterItem"][] | components["schemas"]["simpleSearchAndFlatFilterItem"])[];
|
|
8823
|
+
/** @description Used to perform NOT filter. Can be a single filter or a list of filters to perform a !(AND). {not:[A,B]} is equivalent to !(A AND B) */
|
|
8824
|
+
not?: components["schemas"]["simpleSearchAndFlatFilterItem"][] | components["schemas"]["simpleSearchAndFlatFilterItem"];
|
|
8825
|
+
/** @description Filter based on data within a _chunk_ field. */
|
|
8826
|
+
chunk?: {
|
|
8827
|
+
/** @description The path of the chunk field to filter on. For example: description_sentences_chunk_ */
|
|
8828
|
+
path: string;
|
|
8829
|
+
filters: components["schemas"]["simpleSearchAndFlatFilterItem"][];
|
|
8830
|
+
};
|
|
8831
|
+
}> & Partial<{
|
|
8832
|
+
strict?: "must" | "should" | "must_or";
|
|
8833
|
+
condition?: string;
|
|
8834
|
+
field?: string;
|
|
8835
|
+
filter_type?: "text_match" | "word_match" | "term" | "terms" | "text" | "texts" | "match" | "contains" | "substring" | "class" | "category" | "exact_match" | "classes" | "categories" | "exists" | "traditional" | "fuzzy" | "regexp" | "ids" | "date" | "numeric" | "search" | "or" | "word_count" | "character_count" | "dedupe_by_value";
|
|
8836
|
+
condition_value?: unknown;
|
|
8837
|
+
fuzzy?: number;
|
|
8838
|
+
join?: boolean;
|
|
8839
|
+
}>)[];
|
|
8840
|
+
field: string;
|
|
8841
|
+
tags_to_delete: string[];
|
|
8027
8842
|
};
|
|
8028
|
-
|
|
8843
|
+
DeleteTagsOutput: unknown;
|
|
8844
|
+
MergeTagsInput: {
|
|
8029
8845
|
filters?: (Partial<{
|
|
8030
8846
|
/** @description Match where document[field] is in value list. */
|
|
8031
8847
|
match?: {
|
|
@@ -8271,23 +9087,6 @@ export interface components {
|
|
|
8271
9087
|
fuzzy?: number;
|
|
8272
9088
|
join?: boolean;
|
|
8273
9089
|
}>)[];
|
|
8274
|
-
/** @description Updates to make to the documents. It should be specified in a format of {"field_name": "value"}. e.g. {"item.status" : "Sold Out"} */
|
|
8275
|
-
updates: {
|
|
8276
|
-
[key: string]: unknown;
|
|
8277
|
-
};
|
|
8278
|
-
};
|
|
8279
|
-
UpdateWhereOutput: {
|
|
8280
|
-
/** @description Completion status. */
|
|
8281
|
-
status: string;
|
|
8282
|
-
/** @description Response message for completion state. */
|
|
8283
|
-
message: string;
|
|
8284
|
-
};
|
|
8285
|
-
DeleteTagsInput: {
|
|
8286
|
-
field: string;
|
|
8287
|
-
tags_to_delete: string[];
|
|
8288
|
-
};
|
|
8289
|
-
DeleteTagsOutput: unknown;
|
|
8290
|
-
MergeTagsInput: {
|
|
8291
9090
|
field: string;
|
|
8292
9091
|
tags_to_merge: {
|
|
8293
9092
|
[key: string]: string;
|
|
@@ -14878,6 +15677,44 @@ export interface operations {
|
|
|
14878
15677
|
};
|
|
14879
15678
|
};
|
|
14880
15679
|
};
|
|
15680
|
+
/**
|
|
15681
|
+
* Append tags to tag field.
|
|
15682
|
+
*
|
|
15683
|
+
* ### Required permissions
|
|
15684
|
+
* > [
|
|
15685
|
+
* {
|
|
15686
|
+
* "actions": [
|
|
15687
|
+
* "datasets:write"
|
|
15688
|
+
* ],
|
|
15689
|
+
* "datasets": [
|
|
15690
|
+
* {
|
|
15691
|
+
* "params": "dataset_id"
|
|
15692
|
+
* }
|
|
15693
|
+
* ]
|
|
15694
|
+
* }
|
|
15695
|
+
* ]
|
|
15696
|
+
*/
|
|
15697
|
+
AppendTags: {
|
|
15698
|
+
parameters: {
|
|
15699
|
+
path: {
|
|
15700
|
+
/** ID of dataset */
|
|
15701
|
+
dataset_id: string;
|
|
15702
|
+
};
|
|
15703
|
+
};
|
|
15704
|
+
responses: {
|
|
15705
|
+
/** successful operation */
|
|
15706
|
+
200: {
|
|
15707
|
+
content: {
|
|
15708
|
+
"application/json": components["schemas"]["AppendTagsOutput"];
|
|
15709
|
+
};
|
|
15710
|
+
};
|
|
15711
|
+
};
|
|
15712
|
+
requestBody: {
|
|
15713
|
+
content: {
|
|
15714
|
+
"application/json": components["schemas"]["AppendTagsInput"];
|
|
15715
|
+
};
|
|
15716
|
+
};
|
|
15717
|
+
};
|
|
14881
15718
|
/**
|
|
14882
15719
|
* Delete tags from tag field by tag value. tag field can be in format ["cat"], or [{"label":"cat"}]
|
|
14883
15720
|
*
|
package/package.json
CHANGED