mirror of
https://git.mirrors.martin98.com/https://github.com/jina-ai/reader
synced 2025-04-19 12:20:02 +08:00
saas: minor adjustments for search
This commit is contained in:
parent
f472f02a50
commit
c758ec5b51
@ -88,7 +88,7 @@ export class SearcherHost extends RPCHost {
|
|||||||
searchExplicitOperators: GoogleSearchExplicitOperatorsDto,
|
searchExplicitOperators: GoogleSearchExplicitOperatorsDto,
|
||||||
@Param('count', { validate: (v: number) => v >= 0 && v <= 20 })
|
@Param('count', { validate: (v: number) => v >= 0 && v <= 20 })
|
||||||
count: number,
|
count: number,
|
||||||
@Param('variant', { type: new Set(['web', 'images', 'news']), default: 'web' })
|
@Param('type', { type: new Set(['web', 'images', 'news']), default: 'web' })
|
||||||
variant: 'web' | 'images' | 'news',
|
variant: 'web' | 'images' | 'news',
|
||||||
@Param('provider', { type: new Set(['google', 'bing']), default: 'google' })
|
@Param('provider', { type: new Set(['google', 'bing']), default: 'google' })
|
||||||
searchEngine: 'google' | 'bing',
|
searchEngine: 'google' | 'bing',
|
||||||
@ -173,10 +173,10 @@ export class SearcherHost extends RPCHost {
|
|||||||
let chargeAmountScaler = 1;
|
let chargeAmountScaler = 1;
|
||||||
if (searchEngine === 'bing') {
|
if (searchEngine === 'bing') {
|
||||||
this.threadLocal.set('bing-preferred', true);
|
this.threadLocal.set('bing-preferred', true);
|
||||||
chargeAmountScaler = 2;
|
chargeAmountScaler = 3;
|
||||||
}
|
}
|
||||||
if (variant !== 'web') {
|
if (variant !== 'web') {
|
||||||
chargeAmountScaler = 3;
|
chargeAmountScaler = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
const r = await this.cachedSearch({
|
const r = await this.cachedSearch({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user