lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Huber <>
Subject AnalyzingInfixSuggester Lucene 5.3.0
Date Mon, 24 Aug 2015 09:02:27 GMT

I am extending AnalyzingInfixSuggester for use with my suggester where I
change the query to be a AND rather than an OR in the finishQuery(..)


     * Subclass can override this to tweak the Query before searching.
    protected Query finishQuery(Builder in, boolean allTermsRequired) {

        // Update contexts to be ANDs (MUST) rather than ORs (SHOULD)
        for (BooleanClause booleanClause : {
            // Change the contexts to be MUST (will be the only
BooleanQuery and others will be TermQuery)
            if (booleanClause.getQuery() instanceof BooleanQuery) {
                BooleanQuery bq = (BooleanQuery) booleanClause.getQuery();
                for (BooleanClause bc : bq) {
                // We are done


It says that BooleanClause.setOccur(..) is depreciated and will be *immutable
in 6.0*, how would I then be able to do this?

Cheers Greg

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message