diff --git a/server-application-server/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/HibernateSearchDAOV3Adaptor.java b/server-application-server/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/HibernateSearchDAOV3Adaptor.java index 91415f26c92b2b842e80531ac6199e7d4dd7b091..ee950a9ec56f25a418d30def762506014ceffa79 100644 --- a/server-application-server/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/HibernateSearchDAOV3Adaptor.java +++ b/server-application-server/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/HibernateSearchDAOV3Adaptor.java @@ -113,7 +113,12 @@ public class HibernateSearchDAOV3Adaptor implements IHibernateSearchDAO { // Obtain global criteria GlobalSearchCriteria globalSearchCriteria = getCriteria(searchableEntity); - globalSearchCriteria.withText().thatMatches(searchTerm); + + if (searchTerm.startsWith("\"") && searchTerm.endsWith("\"")) { + globalSearchCriteria.withText().thatMatches(searchTerm.substring(1, searchTerm.length() - 1)); + } else { + globalSearchCriteria.withText().thatMatches(searchTerm); + } operationLog.info("ADAPTED [FULL TEXT SEARCH] : " + searchableEntity + " [" + searchTerm + "] " + useWildcardSearchMode);