C# Class Rubber.DSL.Query.MoreLikeThisQueryBuilder

A more like this query that finds documents that are "like" the provided {@link #likeText(String)} which is checked against the fields the query is constructed with.
Inheritance: IQueryBuilder
Exibir arquivo Open project: stephenpope/Rubber

Public Methods

Method Description
Analyzer ( string analyzer ) : MoreLikeThisQueryBuilder

The analyzer that will be used to analyze the text. Defaults to the analyzer associated with the fied.

Boost ( float boost ) : MoreLikeThisQueryBuilder
BoostTerms ( float boostTerms ) : MoreLikeThisQueryBuilder

Sets the boost factor to use when boosting terms. Defaults to 1.

LikeText ( string likeText ) : MoreLikeThisQueryBuilder

The text to use in order to find documents that are "like" this.

MaxDocFreq ( int maxDocFreq ) : MoreLikeThisQueryBuilder

Set the maximum frequency in which words may still appear. Words that appear in more than this many docs will be ignored. Defaults to unbounded.

MaxQueryTerms ( int maxQueryTerms ) : MoreLikeThisQueryBuilder

Sets the maximum number of query terms that will be included in any generated query. Defaults to 25.

MaxWordLen ( int maxWordLen ) : MoreLikeThisQueryBuilder

Sets the maximum word length above which words will be ignored. Defaults to unbounded (0).

MinDocFreq ( int minDocFreq ) : MoreLikeThisQueryBuilder

Sets the frequency at which words will be ignored which do not occur in at least this many docs. Defaults to 5.

MinTermFreq ( int minTermFreq ) : MoreLikeThisQueryBuilder

The frequency below which terms will be ignored in the source doc. The default frequency is 2.

MinWordLen ( int minWordLen ) : MoreLikeThisQueryBuilder

Sets the minimum word length below which words will be ignored. Defaults to 0.

MoreLikeThisQueryBuilder ( ) : System

Constructs a new more like this query which uses the "_all" field.

PercentTermsToMatch ( float percentTermsToMatch ) : MoreLikeThisQueryBuilder

The percentage of terms to match. Defaults to 0.3.

StopWords ( ) : MoreLikeThisQueryBuilder

Set the set of stopwords.

Any word in this set is considered "uninteresting" and ignored. Even if your Analyzer allows stopwords, you might want to tell the MoreLikeThis code to ignore them, as for the purposes of document similarity it seems reasonable to assume that "a stop word is never interesting"

ToJsonObject ( ) : object
ToString ( ) : string

Method Details

Analyzer() public method

The analyzer that will be used to analyze the text. Defaults to the analyzer associated with the fied.
public Analyzer ( string analyzer ) : MoreLikeThisQueryBuilder
analyzer string
return MoreLikeThisQueryBuilder

Boost() public method

public Boost ( float boost ) : MoreLikeThisQueryBuilder
boost float
return MoreLikeThisQueryBuilder

BoostTerms() public method

Sets the boost factor to use when boosting terms. Defaults to 1.
public BoostTerms ( float boostTerms ) : MoreLikeThisQueryBuilder
boostTerms float
return MoreLikeThisQueryBuilder

LikeText() public method

The text to use in order to find documents that are "like" this.
public LikeText ( string likeText ) : MoreLikeThisQueryBuilder
likeText string
return MoreLikeThisQueryBuilder

MaxDocFreq() public method

Set the maximum frequency in which words may still appear. Words that appear in more than this many docs will be ignored. Defaults to unbounded.
public MaxDocFreq ( int maxDocFreq ) : MoreLikeThisQueryBuilder
maxDocFreq int
return MoreLikeThisQueryBuilder

MaxQueryTerms() public method

Sets the maximum number of query terms that will be included in any generated query. Defaults to 25.
public MaxQueryTerms ( int maxQueryTerms ) : MoreLikeThisQueryBuilder
maxQueryTerms int
return MoreLikeThisQueryBuilder

MaxWordLen() public method

Sets the maximum word length above which words will be ignored. Defaults to unbounded (0).
public MaxWordLen ( int maxWordLen ) : MoreLikeThisQueryBuilder
maxWordLen int
return MoreLikeThisQueryBuilder

MinDocFreq() public method

Sets the frequency at which words will be ignored which do not occur in at least this many docs. Defaults to 5.
public MinDocFreq ( int minDocFreq ) : MoreLikeThisQueryBuilder
minDocFreq int
return MoreLikeThisQueryBuilder

MinTermFreq() public method

The frequency below which terms will be ignored in the source doc. The default frequency is 2.
public MinTermFreq ( int minTermFreq ) : MoreLikeThisQueryBuilder
minTermFreq int
return MoreLikeThisQueryBuilder

MinWordLen() public method

Sets the minimum word length below which words will be ignored. Defaults to 0.
public MinWordLen ( int minWordLen ) : MoreLikeThisQueryBuilder
minWordLen int
return MoreLikeThisQueryBuilder

MoreLikeThisQueryBuilder() public method

Constructs a new more like this query which uses the "_all" field.
public MoreLikeThisQueryBuilder ( ) : System
return System

PercentTermsToMatch() public method

The percentage of terms to match. Defaults to 0.3.
public PercentTermsToMatch ( float percentTermsToMatch ) : MoreLikeThisQueryBuilder
percentTermsToMatch float
return MoreLikeThisQueryBuilder

StopWords() public method

Set the set of stopwords.

Any word in this set is considered "uninteresting" and ignored. Even if your Analyzer allows stopwords, you might want to tell the MoreLikeThis code to ignore them, as for the purposes of document similarity it seems reasonable to assume that "a stop word is never interesting"

public StopWords ( ) : MoreLikeThisQueryBuilder
return MoreLikeThisQueryBuilder

ToJsonObject() public method

public ToJsonObject ( ) : object
return object

ToString() public method

public ToString ( ) : string
return string