# searchTemplate method

FaceCandidateList searchTemplate(

1. FaceTemplate probe,
2. int maxCandidates

)

Performs a one-to-many search of a face template probe against a previously initialized face indexer and outputs a candidate list. This function is thread safe with other SearchTemplate() calls but not with AddTemplate() calls.

param probe The face template probe. param maxCandidates Maximum number of candidates in the candidate list. return The list of candidates sorted by decreasing match score. throws FaceException An error has occurred during Face Library execution.

## Implementation

    FaceCandidateList searchTemplate(FaceTemplate probe, int maxCandidates) {
      FaceCandidateList candidates = FaceCandidateList();
      var err = faceSDK.id3FaceIndexer_SearchTemplate(_pHandle.value, probe.handle, maxCandidates, candidates.handle);
      if (err != FaceError.success.value) {
        candidates.dispose();
        throw FaceException(err);
      }
      return candidates;
    }