Way to set lucene filters on queries

Bug #723186 reported by Lassi Immonen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Querydsl
Fix Released
Undecided
Unassigned

Bug Description

Lucene has DuplicateFilter which could be used to filter distinct fields on documents. It would be nice to be able to utilize this filter in queries. For example query.where(name.distinct(LAST_OCCURRENCE).eq("Timo")) or some other neat way.

Tags: lucene
Revision history for this message
Timo Westkämper (timo-westkamper) wrote :

Added support for distinct(path) and general filtering :

    /**
     * Add a DuplicateFilter for the field of the given property path
     *
     * @param property
     * @return
     */
    public Q distinct(Path<?> property){
        return filter(new DuplicateFilter(serializer.toField(property)));
    }

    /**
     * Apply the given Lucene filter to the search results
     *
     * @param filter
     * @return
     */
    @SuppressWarnings("unchecked")
    public Q filter(Filter filter){
        this.filter = filter;
        return (Q)this;
    }

Changed in querydsl:
status: New → Fix Committed
Revision history for this message
Timo Westkämper (timo-westkamper) wrote :

Released in 2.2.0-beta1

Changed in querydsl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.