Class MoreLikeThisQuery
A simple wrapper for MoreLikeThis for use in scenarios where a Lucene.Net.Search.Query object is required eg in custom QueryParser extensions. At query.Rewrite() time the reader is used to construct the actual MoreLikeThis object and obtain the real Lucene.Net.Search.Query object.
Inherited Members
Namespace: Lucene.Net.Queries.Mlt
Assembly: Lucene.Net.Queries.dll
Syntax
public class MoreLikeThisQuery : Query
Constructors
MoreLikeThisQuery(string, string[], Analyzer, string)
A simple wrapper for MoreLikeThis for use in scenarios where a Lucene.Net.Search.Query object is required eg in custom QueryParser extensions. At query.Rewrite() time the reader is used to construct the actual MoreLikeThis object and obtain the real Lucene.Net.Search.Query object.
Declaration
public MoreLikeThisQuery(string likeText, string[] moreLikeFields, Analyzer analyzer, string fieldName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | likeText | |
| string[] | moreLikeFields | fields used for similarity measure |
| Analyzer | analyzer | |
| string | fieldName |
Properties
Analyzer
A simple wrapper for MoreLikeThis for use in scenarios where a Lucene.Net.Search.Query object is required eg in custom QueryParser extensions. At query.Rewrite() time the reader is used to construct the actual MoreLikeThis object and obtain the real Lucene.Net.Search.Query object.
Declaration
public virtual Analyzer Analyzer { get; set; }
Property Value
| Type | Description |
|---|---|
| Analyzer |
LikeText
A simple wrapper for MoreLikeThis for use in scenarios where a Lucene.Net.Search.Query object is required eg in custom QueryParser extensions. At query.Rewrite() time the reader is used to construct the actual MoreLikeThis object and obtain the real Lucene.Net.Search.Query object.
Declaration
public virtual string LikeText { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
MaxQueryTerms
A simple wrapper for MoreLikeThis for use in scenarios where a Lucene.Net.Search.Query object is required eg in custom QueryParser extensions. At query.Rewrite() time the reader is used to construct the actual MoreLikeThis object and obtain the real Lucene.Net.Search.Query object.
Declaration
public virtual int MaxQueryTerms { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
MinDocFreq
A simple wrapper for MoreLikeThis for use in scenarios where a Lucene.Net.Search.Query object is required eg in custom QueryParser extensions. At query.Rewrite() time the reader is used to construct the actual MoreLikeThis object and obtain the real Lucene.Net.Search.Query object.
Declaration
public virtual int MinDocFreq { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
MinTermFrequency
A simple wrapper for MoreLikeThis for use in scenarios where a Lucene.Net.Search.Query object is required eg in custom QueryParser extensions. At query.Rewrite() time the reader is used to construct the actual MoreLikeThis object and obtain the real Lucene.Net.Search.Query object.
Declaration
public virtual int MinTermFrequency { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
MoreLikeFields
A simple wrapper for MoreLikeThis for use in scenarios where a Lucene.Net.Search.Query object is required eg in custom QueryParser extensions. At query.Rewrite() time the reader is used to construct the actual MoreLikeThis object and obtain the real Lucene.Net.Search.Query object.
Declaration
public virtual string[] MoreLikeFields { get; set; }
Property Value
| Type | Description |
|---|---|
| string[] |
PercentTermsToMatch
A simple wrapper for MoreLikeThis for use in scenarios where a Lucene.Net.Search.Query object is required eg in custom QueryParser extensions. At query.Rewrite() time the reader is used to construct the actual MoreLikeThis object and obtain the real Lucene.Net.Search.Query object.
Declaration
public virtual float PercentTermsToMatch { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
StopWords
A simple wrapper for MoreLikeThis for use in scenarios where a Lucene.Net.Search.Query object is required eg in custom QueryParser extensions. At query.Rewrite() time the reader is used to construct the actual MoreLikeThis object and obtain the real Lucene.Net.Search.Query object.
Declaration
public virtual ISet<string> StopWords { get; set; }
Property Value
| Type | Description |
|---|---|
| ISet<string> |
Methods
Equals(object)
Determines whether the specified object is equal to the current object.
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | The object to compare with the current object. |
Returns
| Type | Description |
|---|---|
| bool | true if the specified object is equal to the current object; otherwise, false. |
Overrides
GetHashCode()
Serves as the default hash function.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | A hash code for the current object. |
Overrides
Rewrite(IndexReader)
Expert: called to re-write queries into primitive queries. For example, a Lucene.Net.Search.PrefixQuery will be rewritten into a Lucene.Net.Search.BooleanQuery that consists of Lucene.Net.Search.TermQuerys.
Declaration
public override Query Rewrite(IndexReader reader)
Parameters
| Type | Name | Description |
|---|---|---|
| IndexReader | reader |
Returns
| Type | Description |
|---|---|
| Query |
Overrides
ToString(string)
Declaration
public override string ToString(string field)
Parameters
| Type | Name | Description |
|---|---|---|
| string | field |
Returns
| Type | Description |
|---|---|
| string |