protected Query createQuery() {
        Query returnedQuery = null;
        Query originalQuery = null;
        if (queryMixin.getMetadata().getWhere() == null) {
            originalQuery = new MatchAllDocsQuery();
        } else {
            originalQuery = serializer.toQuery(queryMixin.getMetadata()
                    .getWhere(), queryMixin.getMetadata());
        }
        Filter filter = getFilter();
        if (filter != null) {
            BooleanQuery booleanQuery = new BooleanQuery();
            booleanQuery.add(originalQuery, Occur.MUST);
            booleanQuery.add(filter, Occur.FILTER);
            returnedQuery = booleanQuery;
        } else {
            returnedQuery = originalQuery;
        }

        return returnedQuery;
    }
AbstractLuceneQuery is an abstract super class for Lucene query
implementations

@author tiwe

@param <T>
           projection type
@param <Q>
           concrete subtype of querydsl
querydsl-lucene5/src/main/java/com/querydsl/lucene5/AbstractLuceneQuery.java