ejsConstantScoreQuery

A constant score query wraps another Query or Filter and returns a constant score for each result that is equal to the query boost.

Note that lucene's query normalization (queryNorm) attempts to make scores between different queries comparable. It does not change the relevance of your query, but it might confuse you when you look at the score of your documents and they are not equal to the query boost value as expected. The scores were normalized by queryNorm, but maintain the same relevance.

Module

 ConstantScoreQuery

ConstantScoreQuery ( )

Constructs a query where each documents returned by the internal query or filter have a constant score equal to the boost factor.


Method Summary

Returns Name Description
String_type()The type of ejs object. For internal use only.
Objectboost(boost)Sets the boost value for documents matching the Query.
Objectcache(trueFalse)Enables caching of the filter.
ObjectcacheKey(k)Set the cache key.
Objectfilter(oFilter)Adds the filter to apply a constant score to.
Objectquery(oQuery)Adds the query to apply a constant score to.
StringtoJSON()Retrieves the internal query object. This is typically used by internal API functions so use with caution.

Method Detail

 _type

String _type ( )
The type of ejs object. For internal use only.

Returns
the type of object

 boost

Object boost ( boost )
Sets the boost value for documents matching the Query.

Parameters
boost <Double> A positive double value.
Returns
returns this so that calls can be chained.

 cache

Object cache ( trueFalse )
Enables caching of the filter.

Parameters
trueFalse <Boolean> A boolean value.
Returns
returns this so that calls can be chained.

 cacheKey

Object cacheKey ( k )
Set the cache key.

Parameters
k <String> A string cache key.
Returns
returns this so that calls can be chained.

 filter

Object filter ( oFilter )
Adds the filter to apply a constant score to.

Parameters
oFilter <Object> A valid Filter object
Returns
returns this so that calls can be chained.

 query

Object query ( oQuery )
Adds the query to apply a constant score to.

Parameters
oQuery <Object> A valid Query object
Returns
returns this so that calls can be chained.

 toJSON

String toJSON ( )
Retrieves the internal query object. This is typically used by internal API functions so use with caution.

Returns
returns this object's internal query property.

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo