Class ConstantScoreQuery
A query that wraps another query or a filter and simply returns a constant score equal to the
query boost for every document that matches the filter or query.
For queries it therefore simply strips of all scores and returns a constant one.
Inheritance
System.Object
ConstantScoreQuery
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Assembly: Lucene.Net.dll
Syntax
public class ConstantScoreQuery : Query
Constructors
|
Improve this Doc
View Source
ConstantScoreQuery(Filter)
Wraps a Filter as a Query. The hits will get a constant score
dependent on the boost factor of this query.
If you simply want to strip off scores from a Query, no longer use
new ConstantScoreQuery(new QueryWrapperFilter(query))
, instead
use ConstantScoreQuery(Query)!
Declaration
public ConstantScoreQuery(Filter filter)
Parameters
Type |
Name |
Description |
Filter |
filter |
|
Exceptions
Type |
Condition |
System.ArgumentNullException |
if filter is null .
|
|
Improve this Doc
View Source
ConstantScoreQuery(Query)
Strips off scores from the passed in Query. The hits will get a constant score
dependent on the boost factor of this query.
Declaration
public ConstantScoreQuery(Query query)
Parameters
Type |
Name |
Description |
Query |
query |
|
Exceptions
Type |
Condition |
System.ArgumentNullException |
if query is null .
|
Fields
|
Improve this Doc
View Source
m_filter
Declaration
protected readonly Filter m_filter
Field Value
|
Improve this Doc
View Source
m_query
Declaration
protected readonly Query m_query
Field Value
Properties
|
Improve this Doc
View Source
Filter
Returns the encapsulated filter, returns null
if a query is wrapped.
Declaration
public virtual Filter Filter { get; }
Property Value
|
Improve this Doc
View Source
Query
Returns the encapsulated query, returns null
if a filter is wrapped.
Declaration
public virtual Query Query { get; }
Property Value
Methods
|
Improve this Doc
View Source
CreateWeight(IndexSearcher)
Declaration
public override Weight CreateWeight(IndexSearcher searcher)
Parameters
Returns
Overrides
|
Improve this Doc
View Source
Equals(Object)
Declaration
public override bool Equals(object o)
Parameters
Type |
Name |
Description |
System.Object |
o |
|
Returns
Type |
Description |
System.Boolean |
|
Overrides
|
Improve this Doc
View Source
Declaration
public override void ExtractTerms(ISet<Term> terms)
Parameters
Type |
Name |
Description |
System.Collections.Generic.ISet<Term> |
terms |
|
Overrides
|
Improve this Doc
View Source
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type |
Description |
System.Int32 |
|
Overrides
|
Improve this Doc
View Source
Rewrite(IndexReader)
Declaration
public override Query Rewrite(IndexReader reader)
Parameters
Returns
Overrides
|
Improve this Doc
View Source
ToString(String)
Declaration
public override string ToString(string field)
Parameters
Type |
Name |
Description |
System.String |
field |
|
Returns
Type |
Description |
System.String |
|
Overrides