querqy.lucene.rewrite.NeverMatchQueryFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of querqy-lucene Show documentation
Show all versions of querqy-lucene Show documentation
Querqy library for query rewriting for Lucene
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