Package org.ametys.cms.search.query
Class AbstractMultivaluedQuery<T>
java.lang.Object
org.ametys.cms.search.query.AbstractOperatorQuery<List<T>>
org.ametys.cms.search.query.AbstractMultivaluedQuery<T>
- Type Parameters:
T- the value type.
- Direct Known Subclasses:
ContentAttachmentQuery,ContentIdQuery,ContentLanguageQuery,ContentTypeQuery,MixinTypeQuery,TagQuery,UsersQuery,WorkflowNameQuery,WorkflowStepQuery
Base class for multivalued queries.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.ametys.cms.search.query.Query
Query.LogicalOperator, Query.Operator -
Field Summary
Fields inherited from interface org.ametys.cms.search.query.Query
BOOL_FILTER, BOOL_MUST, BOOL_MUST_NOT, BOOL_SHOULD -
Constructor Summary
ConstructorsConstructorDescriptionAbstractMultivaluedQuery(String fieldName, Query.Operator operator, Query.LogicalOperator logicalOperator, List<T> values) Create a new Query -
Method Summary
Modifier and TypeMethodDescriptionbuild()Build the solr query string representing the Query object.Build the solr query representing the Query object.
The return type may be either String or Map<String, Object> following the Solr JSON Query DSL.booleaninthashCode()singleValueForQuery(T value) Computes the value for Solr clientMethods inherited from class org.ametys.cms.search.query.AbstractOperatorQuery
getFieldName, getOperator, getValue, rewrite, valueForQuery
-
Constructor Details
-
AbstractMultivaluedQuery
public AbstractMultivaluedQuery(String fieldName, Query.Operator operator, Query.LogicalOperator logicalOperator, List<T> values) Create a new Query- Parameters:
fieldName- the Solr field nameoperator- theQuery.OperatorlogicalOperator- the logical operator, default is LogicalOperator.ORvalues- the values
-
-
Method Details
-
singleValueForQuery
Computes the value for Solr client- Parameters:
value- the typed value- Returns:
- the value, adapted for Solr
-
build
Description copied from interface:QueryBuild the solr query string representing the Query object.- Specified by:
buildin interfaceQuery- Overrides:
buildin classAbstractOperatorQuery<List<T>>- Returns:
- the solr query string representing the Query object.
- Throws:
QuerySyntaxException- if the query can't be built because of a syntax error.
-
buildAsJson
Description copied from interface:QueryBuild the solr query representing the Query object.
The return type may be either String or Map<String, Object> following the Solr JSON Query DSL.- Returns:
- the solr query representing the Query object. Can be empty in case of empty query.
- Throws:
QuerySyntaxException- if the query can't be built because of a syntax error.
-
hashCode
- Overrides:
hashCodein classAbstractOperatorQuery<List<T>>
-
equals
- Overrides:
equalsin classAbstractOperatorQuery<List<T>>
-