Package org.ametys.cms.search.query
Class TagQuery
- java.lang.Object
-
- org.ametys.cms.search.query.TagQuery
-
-
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 private boolean
_descendantAutoposting
private Query.LogicalOperator
_logicalOperator
private Query.Operator
_operator
private String[]
_values
-
Constructor Summary
Constructors Constructor Description TagQuery(String value)
Build a TagQuery.TagQuery(String... values)
Build a TagQuery.TagQuery(Query.Operator operator, boolean descendantAutoposting, String value)
Build a TagQuery.TagQuery(Query.Operator operator, boolean descendantAutoposting, String... values)
Build a TagQuery.TagQuery(Query.Operator operator, boolean descendantAutoposting, Query.LogicalOperator logicalOperator, String... values)
Build a TagQuery.TagQuery(Query.Operator operator, String value)
Build a TagQuery.TagQuery(Query.Operator operator, String... values)
Build a TagQuery.
-
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)
Query.LogicalOperator
getLogicalOperator()
Get the logicalOperator.Query.Operator
getOperator()
Get the operator.String[]
getValues()
Get the values.int
hashCode()
-
-
-
Field Detail
-
_operator
private Query.Operator _operator
-
_logicalOperator
private Query.LogicalOperator _logicalOperator
-
_descendantAutoposting
private boolean _descendantAutoposting
-
-
Constructor Detail
-
TagQuery
public TagQuery(String... values)
Build a TagQuery.- Parameters:
values
- the tag IDs to test.
-
TagQuery
public TagQuery(Query.Operator operator, String value)
Build a TagQuery.- Parameters:
operator
- the operator.value
- the tag id to test.
-
TagQuery
public TagQuery(Query.Operator operator, String... values)
Build a TagQuery.- Parameters:
operator
- the operator.values
- the tag IDs to test.
-
TagQuery
public TagQuery(Query.Operator operator, boolean descendantAutoposting, String value)
Build a TagQuery.- Parameters:
operator
- the operator.descendantAutoposting
- true to enable descendant autoposting (parent tags are found), false otherwise.value
- the tag id to test.
-
TagQuery
public TagQuery(Query.Operator operator, boolean descendantAutoposting, String... values)
Build a TagQuery.- Parameters:
operator
- the operator.descendantAutoposting
- true to enable descendant autoposting (parent tags are found), false otherwise.values
- the tag IDs to test.
-
TagQuery
public TagQuery(Query.Operator operator, boolean descendantAutoposting, Query.LogicalOperator logicalOperator, String... values)
Build a TagQuery.- Parameters:
operator
- the operator. The operator is applied to each value individually. For instance, if operator isNE
and logicalOperator isOR
, then the Query represents:(NOT A) OR (NOT B) ...
descendantAutoposting
- true to enable descendant autoposting (parent tags are found), false otherwise.logicalOperator
- the logical operator.values
- the tag IDs to test.
-
-
Method Detail
-
getOperator
public Query.Operator getOperator()
Get the operator.- Returns:
- the operator
-
getLogicalOperator
public Query.LogicalOperator getLogicalOperator()
Get the logicalOperator.- Returns:
- the logicalOperator
-
build
public String build() throws QuerySyntaxException
Description copied from interface:Query
Build the solr query string representing the Query object.- Specified by:
build
in interfaceQuery
- Returns:
- the solr query string representing the Query object.
- Throws:
QuerySyntaxException
- if the query can't be built because of a syntax error.
-
-