Skip to main content

TM Filters and Sort (Object)

Not yet released

This JSON object customizes how top hits are selected and further permits to apply filters on various properties such as status, bookmarks, context, change date and so on.

The object is generally accessible as the tmhits property in API methods:


Important notice:

The tmhits filter and sort options are only available if the tmhitsEnabled property is true in the rights properties. Until end of 2018, this will be the case for all customers.


Default values:

All properties below are optional.

Presets can be specified in word count profiles in Wordbee Translator (and thus be linked to projects and jobs).

The preset values are available when getting the access rights details: Rights (Object)

PROPERTIES

The properties are:

ctxboost

Optional. Specifies to what extent a matching context promotes a hit in the search results.

  • 0: Disabled. The search results disregard whether the context matches or not.
  • 1: Minimal promotion. Makes sure that the top results contain good hits that also match the context
  • ...
  • 5: Maximal promotion. This will give high importance to hits with the same context, even if text similarity is not so high.

With this setting you can give additional boost to hits that have the same context value as the segment being searched. The context of a segment typically contains formatting information such as "Heading 1", "Hyperlink" etc. or, when localizing software, string IDs or keys. Specifically with software localization this setting should be increased.

CODE
"ctxboost": 1

int?

Optional

filters

Optional array of filters on various properties such as status, bookmarks, context, change date and so on. Example:

CODE
"filters": [
   { "field": "st", "values": [ 1 ] },
   { "field": "bk", "values": [ 1, 2 ] }
]

See below.

object[]?

Optional

 

Filters

Each array element of filters has a field property which defines the field in a segment or language to be filtered.

The 

Field propertyDescription of filter
st

To filter by status of the source text or translation.

The mandatory values property is an array of statuses:

  • 0: No status (gray)
  • 1: Approved (green)
  • 2: Contains an error (red)

The optional language property can have these values:

  • src: Apply filter on the source language(s)
  • trg: Apply filter on the target language(s)
  • Other/Empty: Uses trg by default

Example:

CODE
{
   "field": "st",
   "values": [ 0, 1 ],
   "language": "trg"
}



bk

To filter by bookmark of the source text or translation.

The mandatory values property is an array of bookmarks:

  • 0: No bookmark
  • 1: Blue bookmark
  • 2: Red bookmark

The optional language property can have these values:

  • src: Apply filter on the source language(s)
  • trg: Apply filter on the target language(s)
  • Other/Empty: Uses trg by default


CODE
{
   "field": "bk",
   "values": [ 0, 1 ]
}
ctx

To filter by the context of a segment.

The mandatory values property is a list of strings to match. The filter is case sensitive.

The optional mode property permits values infix and prefix. By default prefix is used. Example for matching hits with context containing either "alpha" or "beta".

CODE
{
   "field": "ctx",
   "values": [ "alpha", "beta" ],
   "mode": "infix"
}


The optional not filter permits to find all segments that do not have any of the specified contexts:

CODE
{
   "field": "ctx",
   "not": true,
   "values": [ "alpha", "beta" ],
   "mode": "prefix"
}



lbls

NOT IMPLEMENTED

Optional list of labels to match.

The id is the label's unique ID. The values property contains zero, one or more label values.

If the values array is empty then the search returns hits without any label value set only.

The optional language property can have these values:

  • src: Apply filter on the source language(s)
  • trg: Apply filter on the target language(s)
  • Other/Empty: Uses trg by default


CODE
{
   "field": "lbls",
   "language": "src"
   "values": [ { "id": 2, "values": [ 10, 11 ] }, { "id": 3, "values": [ 0 ] } ]
}
usdt

To filter by last change date of source text or translation.

The optional gte (edit at or after date) and lt (edit before date) permit to delimit the wanted date of change. Dates must be ISO formatted:

CODE
{
   "field": "usdt",
   "language": "src"
   "gte": "2016-10-21T10:00:00Z",
   "lt": "2018-10-21T10:00:00Z"
}

The optional language property can have these values:

  • src: Apply filter on the source language(s)
  • trg: Apply filter on the target language(s)
  • Other/Empty: Uses trg by default


ed

To filter by the last editor of the source text or translation: Human edit, Pre-translation, Machine translation etc.

The mandatory values property is a list of last editor values. See Last Editor (Enumeration)

CODE
{
   "field": "ed",
   "values": [ 0, 1, 2 ]
}

The optional language property can have these values:

  • src: Apply filter on the source language(s)
  • trg: Apply filter on the target language(s)
  • Other/Empty: Uses trg by default



EXAMPLES

Retains translations without error and blue bookmark:

CODE
"filter": [
   { "field": "st", "values": [ 0, 1 ], "language": "trg" },
   { "field": "bk", "values": [ 1 ], "language": "trg" }
]

 

 


JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.