mbd-studio-sdk 3.7.0 → 4.0.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/V1/Studio.js +9 -2
- package/package.json +1 -1
package/V1/Studio.js
CHANGED
|
@@ -60,8 +60,9 @@ export class Studio {
|
|
|
60
60
|
const hits = this._candidates || [];
|
|
61
61
|
const features = featuresResult.features;
|
|
62
62
|
const scores = featuresResult.scores;
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
const info = featuresResult.info;
|
|
64
|
+
if (!features && !scores && !info) {
|
|
65
|
+
this._log('No features, scores, or info found in featuresResult');
|
|
65
66
|
return;
|
|
66
67
|
}
|
|
67
68
|
let availableFeatures = {};
|
|
@@ -70,6 +71,7 @@ export class Studio {
|
|
|
70
71
|
const hitIndex = findIndex(hit._index);
|
|
71
72
|
const hitFeatures = features?.[hitIndex]?.[hit._id];
|
|
72
73
|
const hitScores = scores?.[hitIndex]?.[hit._id];
|
|
74
|
+
const hitInfo = info?.[hitIndex]?.[hit._id];
|
|
73
75
|
if (hit._features) {
|
|
74
76
|
hit._features = { ...hit._features, ...hitFeatures };
|
|
75
77
|
} else {
|
|
@@ -90,6 +92,11 @@ export class Studio {
|
|
|
90
92
|
if (typeof value === 'number' && !Number.isNaN(value)) availableScores[key] = true;
|
|
91
93
|
}
|
|
92
94
|
}
|
|
95
|
+
if (hit._info) {
|
|
96
|
+
hit._info = { ...hit._info, ...hitInfo };
|
|
97
|
+
} else {
|
|
98
|
+
hit._info = hitInfo;
|
|
99
|
+
}
|
|
93
100
|
}
|
|
94
101
|
availableFeatures = sortAvailableFeatures(Object.keys(availableFeatures));
|
|
95
102
|
availableScores = sortAvailableFeatures(Object.keys(availableScores));
|