Search in sources :

Example 1 with ILuceneQuery

use of org.jboss.tools.hibernate.search.runtime.spi.ILuceneQuery 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

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