Permits to find segments by a wide range of criteria.
(POST) /api/resources/segments/search
The message body contains a JSON object with these properties.
scope | The scope object. It delimits the total range of segments and related resources that can be queried. Example:
| Mandatory, object | ||
query | The filters to apply. See chapters further down. Get segments in scope with a word in English and where the German translation has green status. Further, we want the segment context to be a "Heading" (we suppose we translate a Microsoft Word document).
| Optional, object? | ||
layout | Optional layout object. The layout presets the data and the languages you want to retrieve with the results. If not specified or null the layout is preset - see autoLayout property below. | Optional, object? | ||
autoLayout | If layout is not set, the system creates one depending on the values of this property:
This example returns results in 3 languages. Not setting the layoutMode requires explicitly specifying languages:
Alternatively, this can be written more compactly:
| Optional, string | ||
usecache | Optional boolean, default is true. Set to false only if there is a possibility that user access rights have changed. False enforces the system to recalculate all access rights for the specified scope. | Optional, bool? | ||
Smart navigation - See explanation below | ||||
previousSkip | This is the skip value of the currently shown editor page (i.e. before making this call). Use previousSkip and previousTotal when implementing translation editor interfaces. Here the user may apply a filter and navigate between pages. Consider this scenario: User sets a filter to show green status segments only. User is on page 2. Now user, sets some segments into red status and saves changes. Finally, user clicks button to move to next page (3). With smart navigation, the system will adjust the skip value to maintain it on page 2 (since page 2 now shows new segments). | Optional, int? | ||
previousTotal | This is the grand total amount of segments was obtained when showing the current editor page (i.e. the total known by editor before making this call) | Optional, int? | ||
includeRights | Default: false
Use false when possible to reduce http response size. | Optional, bool | ||
includeLayout | Default: false
Use false when possible to reduce http response size. | Optional, bool | ||
data | User custom data. You can put your own data here. It will be persisted when saving/loading queries for later reuse: resources/segments/search/profiles | Optional, string |
To paginate results, use these properties:
query.skip | Optional, default is 0. Used for pagination. Specifies the number of segments in the result set to skip. | Optional, int | |
query.take | Optional, default is 20. Specifies the number of segments to retrieve.
| Optional, int | |
query.sort | Optional. Default is "Natural". Specifies how results shall be sorted:
Example:
| Optional, string | |
query.sortdir | Optional sort direction. Options are:
Example:
Default sort orders:
| Optional, string? | |
query.highlight | Optional, default is null. - THIS FEATURE WILL BE AVAILABLE FROM JULY 2020 Instruction whether to highlight texts in the results that actually matched a filter in that language. Useful with terminology searches where you want to know which of the term variants in a concept actually matched the filter. Without highlighting, the system will return the concept but does not tell you which of the 3 variants is matching. Values are:
| Optional, string? |
Use the goto parameter for advanced navigation:
Instructions:
goto | Navigate to segment by segment ID Specify mode and segment ID as shown below.
| Optional, object | |
Navigate to segment by sequential ID Segments of documents are assigned a sequential ID such as 1, 2, 3-1, 3-2 etc. The first part is the bee segment ID (bsid), the second part is the sub segment ID (bssid).
The bssid is optional. 0 denotes the first sub segment, 1 the second. In the user interfaces we display this number incremented by 1 (after all "3-1" looks better than "3-0" NOTE: This mode is available only with Job or Project scopes. | |||
Navigate to locked text Navigates to the next (next: true) or previous (next:false) locked text relative to the specified segment ID.
The locale parameter is mandatory. | |||
Navigate to non-locked text Navigates to the very first unlocked segment. Here we drop the sid value and thus navigate from the start.
The locale parameter is mandatory. |
The scope generally delimits the searchable resources, documents or segments. If the scope is a project then you will get the documents in this project.The following properties permit to drill down on the scope resources, documents or segments.
query.documentSets | Optional list of resources to search. A resource can be a translation memory, a term base or a project memory. See resources/documentsets to find resources and their IDs (dsid). Example:
| Optional, int[] | |
query.documents | Optional list of documents to search. With projects, a document is, well, a document being translated. With resources it groups segments added to a resource together. See resources/documents/list (post) to find documents and their IDs (did) Each element is an object with these properties:
Example:
| Optional, object[] | |
query.segments | Optional list of segments to search. The segment ID is the sid property included with search results. Example:
| Optional, int[] | |
query.segmentsFT | Optional string with a list of segment IDs or ID ranges. Examples:
| Optional, string? | |
query.segmentNumbers | Optional list of segment numbers to search. The segment number is the bsid property included with search results. It is available with projects and jobs only and is an incremental number starting at 1 (per each document). The number may contain a subsegment ID: 2-1, 2-2, 2-3 (if segment 2 is split into 3 subsegments). | Optional, string[] | |
query.segmentNumbersFT | Optional string with a list of segment IDs or ID ranges. Examples:
| Optional, string? | |
query.resourceTypes | Optional filter on the type of resource to search:. Options are:
Example to search resources only while excluding any documents:
| Optional, int[] |
The scope generally delimits the searchable resources, documents or segments. If the scope is a project then you will get the documents in this project. The following properties permit to drill down on the scope resources, documents or segments.
query.ctx | To filter by the context string of a segment. The context may be the style (such as Heading 1 in a Microsoft Word document) or a software string ID. This element is an object with the following properties: | Optional, object | |
query.ctx.value | The string to search. The search is case-insensitive. | Mandatory, string | |
query.ctx.mode | The search mode, any of these options. If missing then uses the "Prefix" mode. See String filter (Filter) for details. | Optional, string | |
query.constraints | Optional. To find segments that have or have no size constraint (max or min length in translations). Missing or null: No filter. True: Segment must have a size constraint. False: Segment must not have a size constraint. | Optional, bool | |
query.cfs | Optional filter for segment-level custom fields. A array of custom field filters. Each element filters one custom field value:
Example to find values prefixed with "Department" in custom text field #1:
When specifying multiple items, all of them must match. | Optional, object[] | |
query.lbls | Optional filter for segment-level labels. A array of label filters. Each element filters one label value:
Example:
When specifying multiple items, all of them must match. | Optional, object[] | |
query.tbx | Optional filter on term-level TBX fields. An array of TBX field and value pairs. Each array element has these properties:
Example:
| Optional, object[] |
To filter source texts and translations.
query.languages | Optional array of languages and filters to apply. This permits to find source texts or translations by a wide range of filter criteria. See table below for object properties. Example: Find all source texts containing word "ministry" and where the German translation if flagged as erroneous.
| Optional, object[] |
Each element in languages has these properties:
locs | An array with one or more language codes. With multiple languages, filters apply to either one of the languages (a boolean "OR"). Let us look at an example: Example 1: Search segments that contain "ministry" in any of the 3 languages:
Example 2: Search segments that contain "ministry" in all of the 3 languages:
| Mandatory, string[] | ||
text | Optional filter on the text of the language. | Optional, object | ||
text.value | The string to search. Find any translation containing a word, case insensitive:
Find all texts starting with:
| Mandatory, string | ||
text.mode | The optional search mode. Uses "Plain" if not specified.
| Optional, string | ||
text.case | Case sensitive constraint. By default false. True: Search is case sensitive. False: Search is case insensitive. | Optional, bool | ||
text.phrase | Optional, default is false. If true then the value must match the complete text. If false then the system does an infix search. With regular expressions or wildcards and phrase set to true: The system automatically prepends and appends * or .*? | Optional, bool | ||
hasText | Optional. Default is null:
| Optional, bool? | ||
hasBadOrMissing | Permits to find erroneous translations:
| Optional, bool? | ||
hasQAError | Filter segments with or without QA error. Optional. Default is null. True: Segments with QA error. False: Segments without QA error. Any dismissed QA errors are not considered. | Optional, bool? | ||
qa | Advanced filter for QA issues, see Searching - QA issues | Optional, object | ||
status | Filter by status. An optional list of one or more statuses. See Text Status (Enumeration)
Example:
| Optional, int[] | ||
bookmarks | Filter by bookmark. An optional list of one or more bookmarks. See Text Bookmark (Enumeration)
Example:
| Optional, int[] | ||
dttext | Filter on the last text change date. This is an optional object. See Date filter (Filter) for details. Examples: Periods are accumulated. The following finds texts changed the last 3 days:
Find changes of October (UTC):
| Optional, object | ||
dtflags | Filter on the last status or bookmark change. This is an optional object. The properties are the same as for dttext. Example for finding any texts changed on or after a date:
| Optional, object | ||
lengthMin lengthMax | Filter on the text length. The following finds all texts between 10 and 20 characters:
Find texts with maximum of 10 characters:
| Optional, int? Optional, int? | ||
locked | Filter texts that are explicitly locked or unlocked for editing.
Example to find locked texts:
| Optional, bool? | ||
hasHistory | Filter texts that have a text change history. A text has a history if the first (initial) text, whether typed by a human or coming from a pre-translation, was changed at least once. Texts with history are generally referred to as post-edited or revised. True: Only locked texts. False: Only unlocked texts. | Optional, bool? | ||
editors | Filter texts by who is responsible for the latest version. See available options here: Last Editor (Enumeration). Find all types of pre-translations:
Find texts last edited by a human:
| Optional, INT[] | ||
pastEditors | Filter texts by who has edited a past version of the text. See available options here: Last Editor (Enumeration). Find any text that was initially a machine translation:
| Optional, INT[] | ||
users | Filter texts that were last edited by specific users.
| Optional, int[] | ||
repetitions | Permits to find repetitions identified during the last word count (e.g. when marking the file for translation in Codyt). This filter must be set on a target language and NOT the source language. Options are:
| Optional, string? | ||
cfs | Optional filter for language-level custom fields. A array of custom field filters. Each element filters one custom field value:
Example to find values prefixed with "Department A" in custom field #1:
When specifying multiple items, all of them must match. | Optional, object[] | ||
lbls | Optional filter for language-level labels. A array of label filters. Each element filters one label value:
Example:
When specifying multiple items, all of them must match. | Optional, object[] | ||
tbx | Optional filter on term-level TBX fields. An array of TBX field and value pairs. Each array element has these properties:
Example:
| Optional, object[] | ||
data | Any additional string data you want to include for your specific purposes. This is useful if you load/save search profiles resources/segments/search/profiles and you need to persist additional data here. | Optional, string? | ||
To filter comments attached to segments.
query.comments | Example to find segments with a comment containing a text:
Filter segments that have one or more comments in either English or French or both:
| Optional, object? | ||
query.comments.locs | An array of the languages to filter. This field is mandatory. All other properties are optional. Just specifying the languages filters segments that have at least 1 comment attached. | Mandatory, string[] | ||
query.comments.txt | Optional text to find in comments. This is an infix search and it is case-insensitive | Optional, string? | ||
query.comments.cat | Optional comments category. When adding a comment to a text, the user can choose a category. Category IDs are numbers 0, 1, 2 in the order they are shown online. The administrator can customize the categories. | Optional, int? | ||
query.comments.uid | Optional filter on the person who submitted the comment. | Optional, int? | ||
query.comments.dt | Optional filter by comment creation/change date. This object has optional properties:
Note: Specify either min/max or minutes/hours/days. | Optional, object? | ||
query.comments.tsk | Optional filter on the job the submitting user was working on. Task codes are "TR", "RV", etc. and can be customized by the platform administrator. | Optional, string? |
The message body contains a JSON object:
SEGMENTS | |||
result.rows | The list of segments. Includes main segment properties as well as the data columns specified in the layout parameter. The format is explained further down in this page. | object[] | |
result.total | Total segments in scope or query. Not dependent on pagination parameters skip and take. | int | |
result.skip | The skip parameter supplied to the method.
| ||
result.take | The take pagination parameter. If you pass no take value to the method, this will be preset to the system default. | int | |
DOCUMENTS AND USERS | |||
result.docs | A dictionary with all documents that appear in the results. This permits to show document names and more information per segment (see the did property of a segment). The format is explained further down in this page. | object | |
result.users | A dictionary with all users/persons that are referenced by the segments included with the results. A segment references the persons that have last changed a text, a status, a bookmark etc. The format is explained further down in this page. | object | |
RIGHTS AND LAYOUT | |||
columns | A JSON array with column details. This enriches the layout object above with a few additional properties (such as if a language is RTL etc). | object[] | |
layout | Optional. Populated if includeLayout parameter is explicitly set to true. The layout object. The layout passed to the API method or a default layout. The layout is "cleaned" in that columns not visible to the current user will be removed. See Spreadsheet Layout (Object) for full details. | object | |
rights | Optional. Populated if includeRights parameter is explicitly set to true. The rights object. It provides very granular information on:
See Rights (Object) for full details. | object | |
GO TO NAVIGATION | |||
gotoSuccess | If you use goto in the request, the API result will include the present property.
| bool? |
A dictionary with all documents that appear in the results. The keys are the document ids (prefixed with underscore).
See Document Details (Object) for full details.
Example:
{ "_12614": { "did": 12614, "dsid": 4227, "name": "Sample.docx", "pmax": null, "pmin": null, "ptype": 4, "pdomain": "MSWORD", "edit": true, "ctags": ["[b]", "[/b]", "sub": [{ "sdid": 1, "sdnm": "Word document" }, { "sdid": 2, "sdnm": "Header" }] } } |
A dictionary with all users that are referenced by the segments in the results. The keys are the user ids (prefixed with underscore).
See Persons List (Object) for full details.
Example:
{ "_7": { "id": 7, "nm": "Stephan", "cid": 1, "cnm": "Tradubee" }, "_3": { "id": 3, "nm": "Thierry", "cid": 1, "cnm": "Freelancebee" } |
Note: Names may be obfuscated if the current user does not have the right to see names.
The "rows" property is an array of segments. Each element has these properties.
See resources/segments/search - Examples