double scores[] = new double[mappings.size()];
boolean foundGoal = false;
for (DictionaryMapping mapping: mappings) {
SchemaDictionaryEntry dictEntry = mapping.getDictEntry();
SchemaMapping smap = mapping.getMapping();
scores[rank-1] = smap.getDist();
// Did the query database match one of the returned results?
System.err.println(" " + rank + ". (" + smap.getDist() + ") " + mapping.getDictEntry().getInfo() + " (size=" + mapping.getDictEntry().getSchema().getFields().size() + ")");
if (dictEntry.getInfo().equals(testName)) {
// If so, find the max rank of any object that had the match's score.
// (This is necessary because multiple objects can have the same match score.
// The current match's rank isn't necessarily the one to use.)
System.err.println("Found mapping: " + smap.toString());
double currentScore = smap.getDist();
int correctRank = rank;
for (int j = 0; j < rank; j++) {
if (scores[j] == currentScore) {
correctRank = j+1;
break;