@SuppressWarnings("unchecked")
    public Q filter(Filter filter) {
        if (filters.isEmpty()) {
            this.filter = filter;
            filters = Collections.singletonList(filter);
        } else {
            this.filter = null;
            if (filters.size() == 1) {
                filters = new ArrayList<Filter>();
            }
            filters.add(filter);
        }
        return (Q) this;
    }
Apply the given Lucene filter to the search results

@param filter filter
@return the current object
querydsl-lucene4/src/main/java/com/querydsl/lucene4/AbstractLuceneQuery.java