Search translation memory (sync)
Translation Memory
Search translation memory (sync)
Overview
- Searches a single translation memory using the primary TM scoring pipeline. The endpoint always returns up to 15
SearchTMResponseDtoentries ordered by score.
Modes
- Standard segment search (default): normalize text, leverage penalties, thresholds, tag metadata, and context. This is the behavior when
phraseQuery=true(default). The service calls the downstream/searchendpoint withwildcard=trueto allow combined exact/wildcard candidates in one pass. - Legacy phrase-only mode: set
phraseQuery=falseto disable the wildcard branch (wildcard=false,exactIfQuotes=false,combinedExact=false). Use when you need strict normalized matches without wildcard processing.
Request parameters
query(required): search text. IftrimQuery=true(default) leading/trailing whitespace is removed before sending to TM service.sourceLang(required) and optionaltargetLangs: locales are normalized to BCP-47. WhentargetLangsis omitted the backend queries all TM targets.previousSegment/nextSegment: optional context strings; when provided, the backend raises 101% matches that align with the surrounding segments.tagMetadata: serialized inline tags; improves scoring and avoids dropping tag pairs.trimQuery: defaulttrue. Set tofalseto preserve leading/trailing spaces (rare).phraseQuery: defaulttrue. Controls whether wildcard/phrase helpers are enabled (see “Modes”).
Scoring & ordering
- Backend computes
grossScore(raw similarity) andscore(penalty-adjusted). 101% matches retain their priority even after penalties. - Ordering priority (per downstream service):
score DESC,grossScore DESC, context match priority DESC, segment key ASC, TM priority ASC, timestamp DESC, TU id DESC. - Numeric replacements or uppercase normalization are not performed here (
replaceFigures=false,modifyTransText=falsein this controller).
Limits & behavior
- Returns maximum 15 matches; there is no
offsetortotalFoundCount. - Threshold is fixed to
0, so all results above penalties are returned until limit. - Multiple target locales per TM are not supported, mirroring backend validation.
- Logical operators (AND/OR/NOT) and wildcard expressions in
queryare interpreted only whenphraseQuery=trueenables the wildcard path.
Context & caching notes
- Downstream service may consult its 60-second cache for identical search inputs (including context and penalties). Freshly imported matches might appear with a short delay if cached results are reused.
- If previous/next segments are omitted the search still runs, but 101% context boosts cannot trigger.
Error handling
- Invalid locales, blank
query, or an inaccessible TM ID return400/403. - Backend may throw when multiple target locales are submitted for a single TM; the controller surfaces that error unchanged.
POST
Search translation memory (sync)
Documentation Index
Fetch the complete documentation index at: https://developers.phrase.com/llms.txt
Use this file to discover all available pages before exploring further.
Authorizations
Get a token from auth/login endpoint and then pass it in the Authorization HTTP header in every subsequent API call. For more information visit our help center.
Path Parameters
Body
application/json
Response
successful operation