perf(plugin): improve searXNG empty result handling and documentation (#3507)

* perf(plugin): improve searXNG empty result handling and documentation

* 修改了文档和代码部分无搜索的结果的反馈
This commit is contained in:
Jiangween
2025-01-02 16:50:10 +08:00
committed by archer
parent 9abbc16036
commit d24d29ac48
2 changed files with 22 additions and 0 deletions

View File

@@ -48,6 +48,16 @@ const main = async (props: Props, retry = 3): Response => {
});
});
if (results.length === 0) {
return {
result: JSON.stringify([]),
error: {
message: 'No search results',
code: 500
}
};
}
return {
result: JSON.stringify(results.slice(0, 10))
};