if (constraints.isSearchInSource()) {
// Source locale
// NB: Assume the first document's locale, or the same target locale
// if there are no documents
// TODO Move source locale to the Project iteration level
LocaleId sourceLocaleId = localeId;
HProjectIteration projectIteration =
projectIterationDAO.getBySlug(projectSlug, iterationSlug);
if (!projectIteration.getDocuments().isEmpty()) {
sourceLocaleId =
projectIteration.getDocuments().values().iterator()
.next().getLocale().getLocaleId();
}
// Content query for source
String sourceAnalyzerName =
TextContainerAnalyzerDiscriminator
.getAnalyzerDefinitionName(sourceLocaleId.getId());
Analyzer sourceAnalyzer =
entityManager.getSearchFactory().getAnalyzer(
sourceAnalyzerName);
Query srcContentPhraseQuery;