C# Class Lucene.Net.Search.BoostingQuery

The BoostingQuery class can be used to effectively demote results that match a given query. Unlike the "NOT" clause, this still selects documents that contain undesirable terms, but reduces their overall score:
 Query balancedQuery = new BoostingQuery(positiveQuery, negativeQuery, 0.01f); 
In this scenario the positiveQuery contains the mandatory, desirable criteria which is used to select all matching documents, and the negativeQuery contains the undesirable elements which are simply used to lessen the scores. Documents that match the negativeQuery have their score multiplied by the supplied "boost" parameter, so this should be less than 1 to achieve a demoting effect This code was originally made available here: mailing list and is documented here: Documentation
Inheritance: Query
Exibir arquivo Open project: synhershko/lucene.net Class Usage Examples

Public Methods

Method Description
BoostingQuery ( Query match, Query context, float boost ) : System
Equals ( Object obj ) : bool
GetHashCode ( ) : int
Rewrite ( IndexReader reader ) : Query
ToString ( String field ) : String

Method Details

BoostingQuery() public method

public BoostingQuery ( Query match, Query context, float boost ) : System
match Query
context Query
boost float
return System

Equals() public method

public Equals ( Object obj ) : bool
obj Object
return bool

GetHashCode() public method

public GetHashCode ( ) : int
return int

Rewrite() public method

public Rewrite ( IndexReader reader ) : Query
reader Lucene.Net.Index.IndexReader
return Query

ToString() public method

public ToString ( String field ) : String
field String
return String