use of org.jboss.tools.hibernate.search.runtime.spi.IFullTextSession in project jbosstools-hibernate by jbosstools.
the class AbstractHSearchService method newIndexRebuild.
@Override
public void newIndexRebuild(ISessionFactory sessionFactory, Set<Class> entities) {
IFullTextSession fullTextSession = getFacadeFactory().createFullTextSession(sessionFactory);
fullTextSession.createIndexerStartAndWait(entities.toArray(new Class[0]));
}
use of org.jboss.tools.hibernate.search.runtime.spi.IFullTextSession in project jbosstools-hibernate by jbosstools.
the class AbstractHSearchService method search.
@Override
public List<Object> search(ISessionFactory sessionFactory, Class<?> entity, String defaultField, String analyzer, String request) {
IFullTextSession session = getFacadeFactory().createFullTextSession(sessionFactory);
IQueryParser queryParser = getFacadeFactory().createQueryParser(defaultField, getAnalyzerByName(analyzer));
ILuceneQuery luceneQuery = queryParser.parse(request);
IQuery query = session.createFullTextQuery(luceneQuery, entity);
return query.list();
}
Aggregations