Search in sources :

Example 1 with IFullTextSession

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]));
}
Also used : IFullTextSession(org.jboss.tools.hibernate.search.runtime.spi.IFullTextSession)

Example 2 with IFullTextSession

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();
}
Also used : IQuery(org.jboss.tools.hibernate.runtime.spi.IQuery) IQueryParser(org.jboss.tools.hibernate.search.runtime.spi.IQueryParser) ILuceneQuery(org.jboss.tools.hibernate.search.runtime.spi.ILuceneQuery) IFullTextSession(org.jboss.tools.hibernate.search.runtime.spi.IFullTextSession)

Aggregations

IFullTextSession (org.jboss.tools.hibernate.search.runtime.spi.IFullTextSession)2 IQuery (org.jboss.tools.hibernate.runtime.spi.IQuery)1 ILuceneQuery (org.jboss.tools.hibernate.search.runtime.spi.ILuceneQuery)1 IQueryParser (org.jboss.tools.hibernate.search.runtime.spi.IQueryParser)1