Request example:
{
"searchString": "The",
"searchType": "source", // could be Source, Target, SourceAndTarget - says where to do search
["searchPosition": "",]
["numResults": 20,]
["msSearchAfterNumResults": 250,]
["loggingThreshold": 0]
}
Response example:Success:
{
"ReturnValue": 0,
"NewSearchPosition": null,
"results": [
{
"source": "For > 100 setups.",
"target": "Für > 100 Aufstellungen.",
"segmentNumber": 10906825,
"id": "",
"documentName": "none",
"documentShortName": "NONE",
"sourceLang": "en-GB",← rfc5646
"targetLang": "de-DE",← rfc5646
"type": "Manual",
"matchType": "undefined",
"author": "",
"timestamp": "20190401T084052Z",
"matchRate": 0,
"markupTable": "OTMXML",
"context": "",
"additionalInfo": ""
}
],
"ErrorMsg": ""
}
Success, but with NewSearchPosition - not all TM was checked, use this position to repeat search:
{
"ReturnValue": 0,
"NewSearchPosition": "8:1",
"results": [
{
"source": "For > 100 setups.",
"target": "Für > 100 Aufstellungen.",
"segmentNumber": 10906825,
"id": "",
"documentName": "none",
"documentShortName": "NONE",
"sourceLang": "en-GB",
"targetLang": "de-DE",
"type": "Manual",
"matchType": "undefined",
"author": "",
"timestamp": "20190401T084052Z",
"matchRate": 0,
"markupTable": "OTMXML",
"context": "",
"additionalInfo": ""
}
],
"ErrorMsg": ""
}
SearchPosition / NewSearchPositionFormat: "7:1"
First is segmeng\record number, second is target number
The NextSearchposition is an internal key of the memory for the next position on sequential access. Since it is an internal key, maintained and understood by the underlying memory plug-in (for EqfMemoryPlugin is it the record number and the position in one record),
no assumptions should be made regarding the content. It is just a string that, should be sent back to OpenTM2 on the next request, so that the search starts from there.
So is the implementation in Translate5: The first request to OpenTM2 contains SearchPosition with an empty string, OpenTM2 returns than a string in NewSearchPosition, which is just resent to OpenTM2 in the next request.
Not found:{
"ReturnValue": 0,
"NewSearchPosition": null,
"ErrorMsg": ""
}TM not found:{
"ReturnValue": 133,
"ErrorMsg": "OtmMemoryServiceWorker::concordanceSearch::"
} |