To create a query match all documents, you should just be able to use Lucene's MatchAllDocsQuery
. I'm not aware of anything in the Hibernate QueryBuilder
that creates a MatchAllDocsQuery
, but it's simple enough to create one through the Lucene API directly, something like:
org.apache.lucene.search.Query allQuery = new org.apache.lucene.search.MatchAllDocsQuery();
fullTextQuery = fullTextSession.createFullTextQuery(allQuery, this.type);
results = tab.getQueryFiltersForSearch(fullTextQuery).setSort(sort).list();