private List<Activity> searchQuestions(String fields, String searchTerm) {
FullTextEntityManager fullTextEntityManager = org.hibernate.search.jpa.Search.getFullTextEntityManager(getEntityManager());
QueryBuilder qb = fullTextEntityManager.getSearchFactory().buildQueryBuilder().forEntity(Question.class).get();
org.apache.lucene.search.Query query = qb.keyword().onFields(fields).matching(searchTerm).createQuery();
javax.persistence.Query persistenceQuery = fullTextEntityManager.createFullTextQuery(query, Question.class);
persistenceQuery.setMaxResults(10);
return (List<Activity>) persistenceQuery.getResultList();
}
private List<Activity> searchWorkTasks(String fields, String searchTerm) {