mirror of
https://git.mirrors.martin98.com/https://github.com/jina-ai/reader
synced 2025-04-18 11:50:00 +08:00
fix: serp edge case
This commit is contained in:
parent
60e67dbafa
commit
572cf91199
@ -519,7 +519,7 @@ export class SearcherHost extends RPCHost {
|
||||
// fallback n times
|
||||
const n = 4;
|
||||
|
||||
while (tryTimes <= n) {
|
||||
while (tryTimes < n) {
|
||||
const delta = Math.ceil(queryTerms.length / n) * tryTimes;
|
||||
terms = containsRTL ? queryTerms.slice(0, queryTerms.length - delta) : queryTerms.slice(delta);
|
||||
const query = terms.join(' ');
|
||||
|
@ -294,7 +294,7 @@ export class SerpHost extends RPCHost {
|
||||
const lastResort = (containsRTL ? queryTerms.slice(queryTerms.length - 2) : queryTerms.slice(0, 2)).join(' ');
|
||||
const n = 4;
|
||||
let terms: string[] = [];
|
||||
while (tryTimes <= n) {
|
||||
while (tryTimes < n) {
|
||||
const delta = Math.ceil(queryTerms.length / n) * tryTimes;
|
||||
terms = containsRTL ? queryTerms.slice(0, queryTerms.length - delta) : queryTerms.slice(delta);
|
||||
const query = terms.join(' ');
|
||||
|
Loading…
x
Reference in New Issue
Block a user