|
|
@@ -56,33 +56,21 @@ export class FFBProductionRepository {
|
|
|
limit: k
|
|
|
}
|
|
|
},
|
|
|
- {
|
|
|
- $lookup: {
|
|
|
- from: this.collectionName,
|
|
|
- localField: "_id",
|
|
|
- foreignField: "_id",
|
|
|
- as: "doc"
|
|
|
- }
|
|
|
- },
|
|
|
- { $unwind: "$doc" },
|
|
|
{
|
|
|
$project: {
|
|
|
- _id: "$doc._id",
|
|
|
- productionDate: "$doc.productionDate",
|
|
|
- site: "$doc.site",
|
|
|
- phase: "$doc.phase",
|
|
|
- block: "$doc.block",
|
|
|
- quantity: "$doc.quantity",
|
|
|
- quantityUom: "$doc.quantityUom",
|
|
|
- weight: "$doc.weight",
|
|
|
- weightUom: "$doc.weightUom",
|
|
|
- // vector: "$doc.vector",
|
|
|
- score: "$_score"
|
|
|
+ _id: 1,
|
|
|
+ productionDate: 1,
|
|
|
+ site: 1,
|
|
|
+ phase: 1,
|
|
|
+ block: 1,
|
|
|
+ quantity: 1,
|
|
|
+ quantityUom: 1,
|
|
|
+ weight: 1,
|
|
|
+ weightUom: 1,
|
|
|
+ score: { "$meta": "vectorSearchScore" } // correctly get the score
|
|
|
}
|
|
|
}
|
|
|
])
|
|
|
.toArray();
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
}
|