@takeshape/schema 12.7.0 → 12.9.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/dist/builtin-schema.js
CHANGED
|
@@ -178,6 +178,10 @@ const builtInShapes = {
|
|
|
178
178
|
type: 'string',
|
|
179
179
|
enum: ['none', 'all'],
|
|
180
180
|
description: "What to do if the analyzer removes all tokens. 'none' returns no results (default), 'all' matches all documents."
|
|
181
|
+
},
|
|
182
|
+
boost: {
|
|
183
|
+
type: 'number',
|
|
184
|
+
description: 'Boost factor to increase or decrease the relevance score of this query. Values greater than 1 increase relevance, values between 0 and 1 decrease it. Default is 1.0.'
|
|
181
185
|
}
|
|
182
186
|
},
|
|
183
187
|
required: ['query']
|
|
@@ -212,6 +216,10 @@ const builtInShapes = {
|
|
|
212
216
|
type: 'string',
|
|
213
217
|
enum: ['none', 'all'],
|
|
214
218
|
description: "What to do if the analyzer removes all tokens. 'none' returns no results (default), 'all' matches all documents."
|
|
219
|
+
},
|
|
220
|
+
boost: {
|
|
221
|
+
type: 'number',
|
|
222
|
+
description: 'Boost factor to increase or decrease the relevance score of this query. Values greater than 1 increase relevance, values between 0 and 1 decrease it. Default is 1.0.'
|
|
215
223
|
}
|
|
216
224
|
},
|
|
217
225
|
required: ['query']
|
package/dist/schema-util.js
CHANGED
|
@@ -223,6 +223,11 @@ export function getCommonBuiltInProperties(shape) {
|
|
|
223
223
|
type: 'string',
|
|
224
224
|
title: 'Shape Id',
|
|
225
225
|
enum: [shape.id]
|
|
226
|
+
},
|
|
227
|
+
_score: {
|
|
228
|
+
type: 'number',
|
|
229
|
+
title: 'Score',
|
|
230
|
+
description: 'The relevance score for this result. Only populated in search contexts where scoring is applied (e.g., using "should" with boost).'
|
|
226
231
|
}
|
|
227
232
|
};
|
|
228
233
|
}
|
|
@@ -27,7 +27,10 @@ export const DeleteResult = getMutationResultType(TemplateVerbs.Delete);
|
|
|
27
27
|
export const TSSearchSortInput = createShape('TSSearchSortInput', {
|
|
28
28
|
type: 'object',
|
|
29
29
|
properties: {
|
|
30
|
-
field: {
|
|
30
|
+
field: {
|
|
31
|
+
type: 'string',
|
|
32
|
+
description: 'The field to sort by. Use "_score" to sort by relevance (useful with boost).'
|
|
33
|
+
},
|
|
31
34
|
order: {
|
|
32
35
|
type: 'string',
|
|
33
36
|
description: '"asc" for ascending or "desc" for descending'
|
|
@@ -418,6 +418,10 @@ export function getWhereSearchArg(projectSchema, selectedShapes) {
|
|
|
418
418
|
where: {
|
|
419
419
|
'@ref': `local:${shapeName}`,
|
|
420
420
|
description: 'The where clause uses the boolean AND, OR, and NOT parameters to construct complex filters based on the values of your fields. It applies an implicit AND to all the top-level keys. To avoid this, use a single OR or NOT key as the only top-level key.'
|
|
421
|
+
},
|
|
422
|
+
should: {
|
|
423
|
+
'@ref': `local:${shapeName}`,
|
|
424
|
+
description: 'The should clause is used for relevance scoring. Unlike "where" which filters in a non-scoring context, queries in "should" contribute to the relevance score. Use this with match_advanced and boost to influence result ranking. Sort by "_score" to see boosted results first.'
|
|
421
425
|
}
|
|
422
426
|
}
|
|
423
427
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@takeshape/schema",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.9.0",
|
|
4
4
|
"description": "TakeShape Schema",
|
|
5
5
|
"homepage": "https://www.takeshape.io",
|
|
6
6
|
"repository": {
|
|
@@ -57,9 +57,9 @@
|
|
|
57
57
|
"p-reduce": "3.0.0",
|
|
58
58
|
"semver": "7.7.2",
|
|
59
59
|
"tiny-invariant": "1.3.3",
|
|
60
|
-
"@takeshape/errors": "12.
|
|
61
|
-
"@takeshape/json-schema": "12.
|
|
62
|
-
"@takeshape/util": "12.
|
|
60
|
+
"@takeshape/errors": "12.9.0",
|
|
61
|
+
"@takeshape/json-schema": "12.9.0",
|
|
62
|
+
"@takeshape/util": "12.9.0"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@takeshape/json-schema-to-typescript": "11.0.0",
|
|
@@ -76,8 +76,8 @@
|
|
|
76
76
|
"glob": "11.0.1",
|
|
77
77
|
"json-schema-to-ts": "3.1.1",
|
|
78
78
|
"shortid": "2.2.16",
|
|
79
|
-
"@takeshape/
|
|
80
|
-
"@takeshape/
|
|
79
|
+
"@takeshape/infra": "12.9.0",
|
|
80
|
+
"@takeshape/logger": "12.9.0"
|
|
81
81
|
},
|
|
82
82
|
"engines": {
|
|
83
83
|
"node": ">=24"
|