@stacksjs/types 0.70.310 → 0.70.312
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/dist/search-engine.d.ts +18 -1
- package/package.json +2 -2
package/dist/search-engine.d.ts
CHANGED
|
@@ -54,11 +54,28 @@ export declare interface SearchEngineOptions {
|
|
|
54
54
|
}
|
|
55
55
|
perPage?: number
|
|
56
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* Options for creating an index.
|
|
59
|
+
*
|
|
60
|
+
* Meilisearch is schemaless and only ever needed `primaryKey`. Typesense and
|
|
61
|
+
* OpenSearch are not: a collection has to declare its fields, their types, and
|
|
62
|
+
* which ones can be faceted or sorted, and it cannot be extended afterwards.
|
|
63
|
+
*
|
|
64
|
+
* Without somewhere to put that, those drivers created a collection holding
|
|
65
|
+
* `id` and nothing else. Documents imported cleanly and then every query
|
|
66
|
+
* failed with "Could not find a field named ... in the schema".
|
|
67
|
+
*
|
|
68
|
+
* Both extra fields are optional and ignored by schemaless engines.
|
|
69
|
+
*/
|
|
70
|
+
export declare interface CreateIndexOptions extends IndexOptions {
|
|
71
|
+
settings?: Settings
|
|
72
|
+
sampleDocument?: Record<string, unknown>
|
|
73
|
+
}
|
|
57
74
|
export declare interface SearchEngineDriver {
|
|
58
75
|
client: () => Meilisearch
|
|
59
76
|
resetClient?: () => void
|
|
60
77
|
search: (index: string, params: any) => Promise<SearchResponse<Record<string, any>>>
|
|
61
|
-
createIndex: (name: string, options?:
|
|
78
|
+
createIndex: (name: string, options?: CreateIndexOptions) => MaybePromise<EnqueuedTask>
|
|
62
79
|
getIndex: (name: string) => Promise<Index<Record<string, any>>>
|
|
63
80
|
addDocument: (indexName: string, params: any) => Promise<EnqueuedTask>
|
|
64
81
|
updateDocuments: (indexName: string, params: DocumentOptions[]) => Promise<EnqueuedTask>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/types",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.70.
|
|
4
|
+
"version": "0.70.312",
|
|
5
5
|
"description": "The Stacks framework types.",
|
|
6
6
|
"author": "Chris Breuer",
|
|
7
7
|
"contributors": [
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
}
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
|
-
"@stacksjs/validation": "0.70.
|
|
74
|
+
"@stacksjs/validation": "0.70.312",
|
|
75
75
|
"better-dx": "^0.2.17",
|
|
76
76
|
"meilisearch": "^0.59.0"
|
|
77
77
|
},
|