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
Modifier and TypeFieldDescriptionprotected ContentHelper
The extension point.protected boolean
true
if the query should be executed with an AndQuery.protected HierarchicalReferenceTablesHelper
The helper to resolve the reference tables.protected boolean
true
if the query should be executed by resolving the children.protected AmetysObjectResolver
The 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
ConstructorDescriptionContentQuery
(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, valueForQuery
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods 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
true
if the query should be executed with an AndQuery. -
_refTableHelper
The helper to resolve the reference tables. -
_resolveChildren
true
if 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.EQ
andQuery.Operator.NE
are 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:Query
Build the solr query string representing the Query object.- Specified by:
build
in interfaceQuery
- Overrides:
build
in 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:
hashCode
in classAbstractOperatorQuery<Object>
-
equals
- Overrides:
equals
in classAbstractOperatorQuery<Object>
-