perf(plugin): improve searXNG empty result handling and documentation (#3507)
* perf(plugin): improve searXNG empty result handling and documentation * 修改了文档和代码部分无搜索的结果的反馈
This commit is contained in:
@@ -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))
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user