diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/HibernateSearchDAO.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/HibernateSearchDAO.java index 16923f9793438942cbf7c9dd887fb7ca221961b2..1ca54589065ea7603680ea398f246748a3bf33f3 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/HibernateSearchDAO.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/HibernateSearchDAO.java @@ -192,13 +192,16 @@ final class HibernateSearchDAO extends HibernateDaoSupport implements IHibernate Query query = null; + Analyzer chosenAnalyzer = analyzer; if (MetaprojectSearch.isMetaprojectField(fieldName)) { String searchTerm = LuceneQueryBuilder.adaptQuery( MetaprojectSearch.getMetaprojectUserQuery(userQuery, userId), useWildcardSearchMode, false); - query = LuceneQueryBuilder.parseQuery(fieldName, searchTerm, new IgnoreCaseAnalyzer()); + query = + LuceneQueryBuilder.parseQuery(fieldName, searchTerm, (chosenAnalyzer = + new IgnoreCaseAnalyzer())); } else { String searchTerm = LuceneQueryBuilder.adaptQuery(userQuery, useWildcardSearchMode); @@ -216,7 +219,7 @@ final class HibernateSearchDAO extends HibernateDaoSupport implements IHibernate hibernateQuery.setFirstResult(0); hibernateQuery.setMaxResults(maxResults); - MyHighlighter highlighter = new MyHighlighter(query, indexReader, analyzer); + MyHighlighter highlighter = new MyHighlighter(query, indexReader, chosenAnalyzer); hibernateQuery.setResultTransformer(new MatchingEntityResultTransformer(searchableEntity, fieldName, highlighter, dataProvider)); List<?> list = hibernateQuery.list();