feat: only return the highest scoring response for searchPermitByAddress
This commit is contained in:
@@ -443,5 +443,6 @@ export async function searchPermit(
|
|||||||
export async function searchPermitByAddress(address: string) {
|
export async function searchPermitByAddress(address: string) {
|
||||||
return await permitModel
|
return await permitModel
|
||||||
.find({ $text: { $search: address } }, { score: { $meta: "textScore" } })
|
.find({ $text: { $search: address } }, { score: { $meta: "textScore" } })
|
||||||
.sort({ score: { $meta: "textScore" } });
|
.sort({ score: { $meta: "textScore" } })
|
||||||
|
.limit(1);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user