use of org.jboss.tools.hibernate.search.runtime.spi.IQueryParser 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();
}
use of org.jboss.tools.hibernate.search.runtime.spi.IQueryParser in project jbosstools-hibernate by jbosstools.
the class FacadeFactoryImpl method createQueryParser.
@Override
public IQueryParser createQueryParser(String defaultField, IAnalyzer analyzer) {
Analyzer luceneAnalyzer = (Analyzer) ((IFacade) analyzer).getTarget();
QueryParser targetParser = new QueryParser(Version.LUCENE_34, defaultField, luceneAnalyzer);
return new AbstractQueryParser(this, targetParser) {
};
}
Aggregations