Description of problem:
Currently, if there are more than 1 100% matches for a string, the most used one is prefilled in the translation.
If something has changed in how a document is translated, the more recent 100% match might be more appropriate then the most used.
The ability to set this preference at several different levels would be helpful, and save translators time.
Are we talking about TM merge (in the editor), or about CopyTrans (which happens on document upload, and can be run manually from the project management page)?
After looking at this in detail, I've found a possible solution for you to try out Alex:
1. Remove the grouping by 'match' at the end of the query. (Leave the other grouping by text flow)
2. Remove the 'match' column in the select portion of the hql query.
The fact that we are getting the Text Flow Target match from that column instead of the max column is the problem.
3. In CopyTransServiceImpl.copyTransPass (around line 230) remove the line that reads
HTextFlowTarget matchingTarget = (HTextFlowTarget)results.get(0);
and replace it with something like
HTextFlowTarget matchingTarget = entityManager.findById((Long)results.get(1));
Hibernate Cache should help us minimize the impact of that extra query.
Keep in mind that because of step #2, those indexes have changed, so the line that reads
HTextFlow originalTf = (HTextFlow)results.get(1);
should now read
HTextFlow originalTf = (HTextFlow)results.get(0);
I have not been able to test this, but try it out and let me know if it solves the issues.
Test with Prod data, it appears to be issue with copyTrans query. Implementing fix now.
Implemented fix in 2.1.3-SNAPSHOT and 2.2-SNAPSHOT
VERIFIED with Zanata version 2.1.3-SNAPSHOT (20130122-0944)