Package org.ametys.cms.search.query
Class ContentQuery
- java.lang.Object
-
- org.ametys.cms.search.query.AbstractFieldQuery
-
- org.ametys.cms.search.query.ContentQuery
-
- All Implemented Interfaces:
Query
public class ContentQuery extends AbstractFieldQuery
Represents aQuery
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
Fields Modifier and Type Field Description protected ContentHelper
_contentHelper
The extension point.protected boolean
_isAndMultipleOperand
true
if the query should be executed with an AndQuery.protected Query.Operator
_operator
The operatorprotected HierarchicalReferenceTablesHelper
_refTableHelper
The helper to resolve the reference tables.protected boolean
_resolveChildren
true
if the query should be executed by resolving the children.protected AmetysObjectResolver
_resolver
The resolver to resolve the results.protected Object
_value
The value to test.-
Fields inherited from class org.ametys.cms.search.query.AbstractFieldQuery
_fieldPath
-
-
Constructor Summary
Constructors Constructor Description ContentQuery(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
build()
Build the solr query string representing the Query object.boolean
equals(Object obj)
Object
getValue()
Get the value.int
hashCode()
-
Methods inherited from class org.ametys.cms.search.query.AbstractFieldQuery
getFieldPath
-
-
-
-
Field Detail
-
_operator
protected Query.Operator _operator
The operator
-
_resolver
protected AmetysObjectResolver _resolver
The resolver to resolve the results.
-
_contentHelper
protected ContentHelper _contentHelper
The extension point.
-
_isAndMultipleOperand
protected boolean _isAndMultipleOperand
true
if the query should be executed with an AndQuery.
-
_refTableHelper
protected HierarchicalReferenceTablesHelper _refTableHelper
The helper to resolve the reference tables.
-
_resolveChildren
protected boolean _resolveChildren
true
if the query should be executed by resolving the children.
-
-
Constructor Detail
-
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 Detail
-
build
public String build() throws QuerySyntaxException
Description copied from interface:Query
Build the solr query string representing the Query 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
public int hashCode()
- Overrides:
hashCode
in classAbstractFieldQuery
-
equals
public boolean equals(Object obj)
- Overrides:
equals
in classAbstractFieldQuery
-
-