Skip to content

Commit 6885260

Browse files
committed
Swtich correction endpoint traffic to use intsch
1 parent 3465678 commit 6885260

File tree

2 files changed

+8
-16
lines changed

2 files changed

+8
-16
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77

88
## [Unreleased]
99

10+
### Changed
11+
12+
- Switch correction endpoint to use intsch as primary with intelligentSearchApi as fallback.
13+
1014
## [1.81.0] - 2025-09-29
1115

1216
### Changed

node/services/autocomplete.ts

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import type { Context } from '@vtex/api'
22

3-
import { compareApiResults } from '../utils/compareResults'
43
import type { Clients } from '../clients'
54

65
/**
@@ -58,24 +57,13 @@ export function fetchSearchSuggestions(ctx: Context<Clients>, query: string) {
5857
'Search Suggestions'
5958
)
6059
}
61-
6260
export function fetchCorrection(ctx: Context<Clients>, query: string) {
6361
const { intelligentSearchApi, intsch } = ctx.clients
6462

65-
return compareApiResults(
66-
() =>
67-
intelligentSearchApi.fetchCorrection({
68-
query,
69-
}),
70-
() =>
71-
intsch.fetchCorrection({
72-
query,
73-
}),
74-
ctx.vtex.production ? 10 : 100,
63+
return withFallback(
64+
() => intsch.fetchCorrection({ query }),
65+
() => intelligentSearchApi.fetchCorrection({ query }),
7566
ctx.vtex.logger,
76-
{
77-
logPrefix: 'Correction',
78-
args: { query },
79-
}
67+
'Correction'
8068
)
8169
}

0 commit comments

Comments
 (0)