Package org.ametys.cms.search.query
Class ContentQuery
Represents a
Query testing a content field.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.ametys.cms.search.query.Query
Query.LogicalOperator, Query.Operator -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ContentHelperThe extension point.protected booleantrueif the query should be executed with an AndQuery.protected HierarchicalReferenceTablesHelperThe helper to resolve the reference tables.protected booleantrueif the query should be executed by resolving the children.protected AmetysObjectResolverThe resolver to resolve the results.Fields inherited from interface org.ametys.cms.search.query.Query
BOOL_FILTER, BOOL_MUST, BOOL_MUST_NOT, BOOL_SHOULD -
Constructor Summary
ConstructorsConstructorDescriptionContentQuery(String fieldPath, Query.Operator operator, Object value, AmetysObjectResolver resolver, ContentHelper contentHelper) Build a content query.ContentQuery(String fieldPath, Query.Operator operator, Object value, AmetysObjectResolver resolver, ContentHelper contentHelper, boolean isAndMultipleOperand) Build a content query by testing the operand.ContentQuery(String fieldPath, Query.Operator operator, Object value, AmetysObjectResolver resolver, ContentHelper contentHelper, HierarchicalReferenceTablesHelper refTableHelper, boolean resolveChildren) Build a content query by testing if the ancestors should be resolved.ContentQuery(String fieldPath, Query.Operator operator, Object value, AmetysObjectResolver resolver, ContentHelper contentHelper, HierarchicalReferenceTablesHelper refTableHelper, boolean resolveChildren, boolean isAndMultipleOperand) Build a content query by testing the operand and if the ancestors should be resolved. -
Method Summary
Methods inherited from class org.ametys.cms.search.query.AbstractOperatorQuery
getFieldName, getOperator, getValue, rewrite, valueForQueryMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.ametys.cms.search.query.Query
buildAsJson, toString
-
Field Details
-
_resolver
The resolver to resolve the results. -
_contentHelper
The extension point. -
_isAndMultipleOperand
trueif the query should be executed with an AndQuery. -
_refTableHelper
The helper to resolve the reference tables. -
_resolveChildren
trueif the query should be executed by resolving the children.
-
-
Constructor Details
-
ContentQuery
public ContentQuery(String fieldPath, Query.Operator operator, Object value, AmetysObjectResolver resolver, ContentHelper contentHelper) Build a content query.- Parameters:
fieldPath- the field's pathoperator- the operatorvalue- the valueresolver- the resolvercontentHelper- the content helper
-
ContentQuery
public ContentQuery(String fieldPath, Query.Operator operator, Object value, AmetysObjectResolver resolver, ContentHelper contentHelper, boolean isAndMultipleOperand) Build a content query by testing the operand.- Parameters:
fieldPath- the field's pathoperator- the operatorvalue- the valueresolver- the resolvercontentHelper- the content helperisAndMultipleOperand- 'true' to execute an AndQuery, OrQuery otherwise
-
ContentQuery
public ContentQuery(String fieldPath, Query.Operator operator, Object value, AmetysObjectResolver resolver, ContentHelper contentHelper, HierarchicalReferenceTablesHelper refTableHelper, boolean resolveChildren) Build a content query by testing if the ancestors should be resolved.- Parameters:
fieldPath- the field's pathoperator- the operatorvalue- the valueresolver- the resolvercontentHelper- the content helperrefTableHelper- The helper to resolve the ancestorsresolveChildren- 'true' to execute an OrQuery on the ancestors and itself, 'false' will execute a join request
-
ContentQuery
public ContentQuery(String fieldPath, Query.Operator operator, Object value, AmetysObjectResolver resolver, ContentHelper contentHelper, HierarchicalReferenceTablesHelper refTableHelper, boolean resolveChildren, boolean isAndMultipleOperand) Build a content query by testing the operand and if the ancestors should be resolved.- Parameters:
fieldPath- the field's pathoperator- The operator. OnlyQuery.Operator.EQandQuery.Operator.NEare allowed.value- the valueresolver- the resolvercontentHelper- the content helperrefTableHelper- The helper to resolve the ancestorsresolveChildren- 'true' to execute an OrQuery on the ancestors and itself, 'false' will execute a join requestisAndMultipleOperand- 'true' to execute an AndQuery, OrQuery otherwise
-
-
Method Details
-
build
Description copied from interface:QueryBuild the solr query string representing the Query object.- Specified by:
buildin interfaceQuery- Overrides:
buildin classAbstractOperatorQuery<Object>- Returns:
- the solr query string representing the Query object.
- Throws:
QuerySyntaxException- if the query can't be built because of a syntax error.
-
hashCode
- Overrides:
hashCodein classAbstractOperatorQuery<Object>
-
equals
- Overrides:
equalsin classAbstractOperatorQuery<Object>
-