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

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

Introduction

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

Prototype

int DEFAULT_MIN_DOC_FREQ

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

Click Source Link

Document

Ignore words which do not occur in at least this many docs.

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(/* ww  w.  j  a v  a  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);
}