Changelog - 2026-11-03
searchCount, facets and suggest take the same tuning as search, and Typesense gains maxCandidates
New FeatureIn one line. Pass engineParams to searchCount(), facets() and suggest() to tune them like search(), so a count, a facet or a suggestion matches the same documents as the search beside it.
What changed
engineParamson the three methods. It takes the same keys as insearch(): the camelCase names ofITypesenseTuningand the engine's wire names. The same checks run before a request, anduseCacheandcacheTtlreach Typesense the same way. Before, an accented query such ascafefoundcaféinsearch()but not insuggest()orfacets(), because there was no way to passnumTyposordropTokensThresholdto them.maxCandidatesinITypesenseTuning. It is sent asmax_candidates, in either spelling, and must be a positive integer;0, a fraction or a string throws before a request.- Sorting is unchanged. It is
filter.orderin the neutral input, sent assort_by, and it already worked insearch(). It is not a tuning key.suggest()takes noorder.
Who is affected
- Apps with a search box. Pass the tuning you use in
search()to the other three. No action needed if you do not. - Scoped search controllers. No change. Their routes call
search()andmultiSearch()only, and they still answer400toengineParams. - Everyone else. No action needed.
Details
typescript
const tuning = { numTypos: 2, maxCandidates: 8 };
const suggestions = await articleRepository.suggest({
query: 'cafe',
queryBy: ['title'],
engineParams: tuning,
});
const { facets } = await articleRepository.facets({
facetBy: ['category'],
query: 'cafe',
queryBy: ['title'],
engineParams: tuning,
});See Search & Typesense for the tuning keys.