All Downloads are FREE. Search and download functionalities are using the official Maven repository.

querqy.lucene.rewrite.NeverMatchQueryFactory Maven / Gradle / Ivy

The newest version!
/**
 * 
 */
package querqy.lucene.rewrite;

import org.apache.lucene.search.MatchNoDocsQuery;
import org.apache.lucene.search.Query;

/**
 * @author René Kriegler, @renekrie
 *
 */
public class NeverMatchQueryFactory implements LuceneQueryFactory {
    
    public static final NeverMatchQueryFactory FACTORY = new NeverMatchQueryFactory();

    @Override
    public void prepareDocumentFrequencyCorrection(final DocumentFrequencyCorrection dfc, final boolean isBelowDMQ) {
        // nothing to do
    }

    @Override
    public Query createQuery(final FieldBoost boostFactor, final TermQueryBuilder termQueryBuilder) {
        return new MatchNoDocsQuery();
    }

    @Override
    public  R accept(final LuceneQueryFactoryVisitor visitor) {
        return visitor.visit(this);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy