mirror of
https://git.mirrors.martin98.com/https://github.com/jina-ai/reader.git
synced 2025-08-18 02:45:56 +08:00
fix: search return amount
This commit is contained in:
parent
1ca29b4b0e
commit
20a7d4d538
@ -147,7 +147,7 @@ export class SearcherHost extends RPCHost {
|
||||
const searchQuery = searchExplicitOperators.addTo(q || noSlashPath);
|
||||
const r = await this.cachedWebSearch({
|
||||
q: searchQuery,
|
||||
num: count ? (isVersion2 ? count : Math.min(Math.floor(count + 2), 12)) : 12
|
||||
num: count > 10 ? 20 : 10
|
||||
}, crawlerOptions.noCache);
|
||||
|
||||
if (!r.organic.length) {
|
||||
@ -161,7 +161,7 @@ export class SearcherHost extends RPCHost {
|
||||
if (isVersion2) {
|
||||
chargeAmount = 10000;
|
||||
const result = [];
|
||||
for (const x of r.organic) {
|
||||
for (const x of r.organic.slice(0, count)) {
|
||||
const url = new URL(x.link);
|
||||
const favicon = await this.getFavicon(url.origin);
|
||||
|
||||
@ -481,7 +481,7 @@ ${suffixMixins.length ? `\n${suffixMixins.join('\n')}\n` : ''}`;
|
||||
return _.every(results, (x) => this.pageQualified(x)) && results.length >= targetResultCount;
|
||||
}
|
||||
|
||||
async getFavicon (domain: string) {
|
||||
async getFavicon(domain: string) {
|
||||
const url = `https://www.google.com/s2/favicons?sz=32&domain_url=${domain}`;
|
||||
|
||||
try {
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit b5e688359eaa87538ef5f43c1323ab92eca8ea33
|
||||
Subproject commit b37a272c11bffc6484715594f8f285ac50e461dd
|
Loading…
x
Reference in New Issue
Block a user