Package org.ametys.cms.search.query
Class MaxScoreOrQuery
- java.lang.Object
-
- org.ametys.cms.search.query.OrQuery
-
- org.ametys.cms.search.query.MaxScoreOrQuery
-
- All Implemented Interfaces:
Query
public class MaxScoreOrQuery extends OrQuery
Same asOrQuery
, but the score for each result will be the max score from the clauses (instead of the sum).
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.ametys.cms.search.query.Query
Query.LogicalOperator, Query.Operator
-
-
Constructor Summary
Constructors Constructor Description MaxScoreOrQuery(float tieBreaker, Collection<Query> queries)
Build a MaxScoreOrQuery object.MaxScoreOrQuery(float tieBreaker, Query... queries)
Build a MaxScoreOrQuery object.MaxScoreOrQuery(Collection<Query> queries)
Build a MaxScoreOrQuery object with default tiebreaker.MaxScoreOrQuery(Query... queries)
Build a MaxScoreOrQuery object with default tiebreaker.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
_tagNameForToString()
The tag name forOrQuery.toString(int)
debug method.String
build()
Build the solr query string representing the Query object.boolean
equals(Object obj)
int
hashCode()
-
Methods inherited from class org.ametys.cms.search.query.OrQuery
collector, getQueries, toString
-
-
-
-
Constructor Detail
-
MaxScoreOrQuery
public MaxScoreOrQuery(Query... queries)
Build a MaxScoreOrQuery object with default tiebreaker.- Parameters:
queries
- the queries.
-
MaxScoreOrQuery
public MaxScoreOrQuery(Collection<Query> queries)
Build a MaxScoreOrQuery object with default tiebreaker.- Parameters:
queries
- the queries as a Collection.
-
MaxScoreOrQuery
public MaxScoreOrQuery(float tieBreaker, Query... queries)
Build a MaxScoreOrQuery object.- Parameters:
tieBreaker
- The tiebreakerqueries
- the queries.
-
MaxScoreOrQuery
public MaxScoreOrQuery(float tieBreaker, Collection<Query> queries)
Build a MaxScoreOrQuery object.- Parameters:
tieBreaker
- The tiebreakerqueries
- the queries as a Collection.
-
-
Method Detail
-
build
public String build() throws QuerySyntaxException
Description copied from interface:Query
Build the solr query string representing the Query object.- Specified by:
build
in interfaceQuery
- Overrides:
build
in classOrQuery
- Returns:
- the solr query string representing the Query object.
- Throws:
QuerySyntaxException
- if the query can't be built because of a syntax error.
-
_tagNameForToString
protected String _tagNameForToString()
Description copied from class:OrQuery
The tag name forOrQuery.toString(int)
debug method.- Overrides:
_tagNameForToString
in classOrQuery
- Returns:
- The tag name for
OrQuery.toString(int)
debug method.
-
-