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
,ContentLanguageQuery
,ContentTypeQuery
,MixinTypeQuery
,TagQuery
,UsersQuery
,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
ConstructorDescriptionAbstractMultivaluedQuery
(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.boolean
int
hashCode()
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.Operator
logicalOperator
- 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:Query
Build the solr query string representing the Query object.- Specified by:
build
in interfaceQuery
- Overrides:
build
in 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:Query
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.- Returns:
- the solr query representing the Query object.
- Throws:
QuerySyntaxException
- if the query can't be built because of a syntax error.
-
hashCode
- Overrides:
hashCode
in classAbstractOperatorQuery<List<T>>
-
equals
- Overrides:
equals
in classAbstractOperatorQuery<List<T>>
-