Example usage for org.apache.lucene.queries.mlt MoreLikeThis DEFAULT_MAX_QUERY_TERMS

List of usage examples for org.apache.lucene.queries.mlt MoreLikeThis DEFAULT_MAX_QUERY_TERMS

Introduction

In this page you can find the example usage for org.apache.lucene.queries.mlt MoreLikeThis DEFAULT_MAX_QUERY_TERMS.

Prototype

int DEFAULT_MAX_QUERY_TERMS

To view the source code for org.apache.lucene.queries.mlt MoreLikeThis DEFAULT_MAX_QUERY_TERMS.

Click Source Link

Document

Return a Query with no more than this many terms.

Usage

From source file:org.apache.solr.handler.RedbubbleMoreLikeThisHandler.java

License:Apache License

private void setMLTparams(SolrParams params, String[] similarityFields, MoreLikeThis mlt) {
    mlt.setMinTermFreq(params.getInt(MoreLikeThisParams.MIN_TERM_FREQ, MoreLikeThis.DEFAULT_MIN_TERM_FREQ));
    mlt.setMinDocFreq(params.getInt(MoreLikeThisParams.MIN_DOC_FREQ, MoreLikeThis.DEFAULT_MIN_DOC_FREQ));
    mlt.setMaxDocFreq(params.getInt(MoreLikeThisParams.MAX_DOC_FREQ, MoreLikeThis.DEFAULT_MAX_DOC_FREQ));
    mlt.setMinWordLen(params.getInt(MoreLikeThisParams.MIN_WORD_LEN, MoreLikeThis.DEFAULT_MIN_WORD_LENGTH));
    mlt.setMaxWordLen(params.getInt(MoreLikeThisParams.MAX_WORD_LEN, MoreLikeThis.DEFAULT_MAX_WORD_LENGTH));
    mlt.setMaxQueryTerms(//from www.j  ava 2  s  . c  om
            params.getInt(MoreLikeThisParams.MAX_QUERY_TERMS, MoreLikeThis.DEFAULT_MAX_QUERY_TERMS));
    mlt.setMaxNumTokensParsed(params.getInt(MoreLikeThisParams.MAX_NUM_TOKENS_PARSED,
            MoreLikeThis.DEFAULT_MAX_NUM_TOKENS_PARSED));
    mlt.setBoost(params.getBool(MoreLikeThisParams.BOOST, false));
    mlt.setFieldNames(similarityFields);
}