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

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

Introduction

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

Prototype

int DEFAULT_MIN_WORD_LENGTH

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

Click Source Link

Document

Ignore words less than this length or if 0 then this has no effect.

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   w w  w . j a va2  s.  c o  m*/
            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);
}