*/
List<FingerprintMatch> fSearchList = null;
if (searchTerms.getFingerprintMatchList() != null) {
fSearchList = new ArrayList<FingerprintMatch>();
for (FingerprintMatch fm : searchTerms.getFingerprintMatchList()) {
FingerprintMatch f = fm.clone();
f.prepare();
fSearchList.add(f);
}
}
/*
* Loop through that portion of the person match array that was
* assigned for processing by this thread.
*
* If any person matched against results in a fingerprint match, or
* a non-fingerprint match above the minimum score threshold, then
* add the person to the list of candidates.
*
* (Note: loop from startIndex to endIndex INCLUSIVE.)
*/
for (int i = startIndex; i <= endIndex; i++) {
PersonMatch pm = personList.get(i);
Scorecard s = searchTerms.scorePersonMatch(pm);
List<FingerprintMatch> fMatchList = pm.getFingerprintMatchList();
if (fSearchList == null) {
s.addScore(Scorecard.SEARCH_TERM_MISSING_WEIGHT, 0, Scorecard.SearchTerm.MISSING);
} else if (fMatchList == null) {
s.addScore(Scorecard.MPI_VALUE_MISSING_WEIGHT, 0);
} else {
double maxScore = 0.0;
for (FingerprintMatch fSearch : fSearchList) {
for (FingerprintMatch fMatch : fMatchList) {
boolean match = fSearch.match(fMatch);
if (match) {
s.setFingerprintMatched(true);
double score = fSearch.score();
if (score > maxScore) {
maxScore = score;
}
}
}
}
double weight = Scorecard.FINGERPRINT_MATCH_WEIGHT;
if (maxScore == 0.0) {
weight = Scorecard.FINGERPRINT_MISS_WEIGHT;
}
s.addScore(weight, maxScore);
if (Mediator.testLoggerLevel(Level.FINEST)) {
Mediator.getLogger(FindPersonThread.class.getName()).log(Level.FINEST,
"Score {0},{1} total {2},{3},{4} comparing fingerprints with person GUID {5}}",
new Object[]{maxScore, weight, s.getTotalScore(), s.getTotalWeight(), s.getSearchTermScore(), pm.getPerson().getPersonGuid()});
}
}
if (s.getSearchTermScore() > CandidateSet.MIN_SCORE || s.isFingerprintMatched()) {
candidateSet.add(pm, s);
}
}
if (fSearchList != null && !fSearchList.isEmpty()) {
for (FingerprintMatch f : fSearchList) {
f.destroy();
}
}
}