Class LabelsQuery
- java.lang.Object
-
- com.atlassian.confluence.search.v2.query.LabelsQuery
-
- All Implemented Interfaces:
Expandable<SearchQuery>
,SearchQuery
public class LabelsQuery extends Object implements SearchQuery
Allows querying by multiple labels. Results returned must match at least one of the specified labels. Although user labels is deprecated, each of them will be included as aPrefixQuery
in the should clause of the finalBooleanQuery
and all other global labels will be ignored if they are ever included in the input collection. If none of the user labels is found, each global label (if specified) will be included as aTermQuery
in the finalBooleanQuery
.- Since:
- 7.20
-
-
Constructor Summary
Constructors Constructor Description LabelsQuery(Set<String> labels)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
SearchQuery
expand()
Expands this query into a composite query (that composes other queries).String
getKey()
Set<String>
getLabels()
List
getParameters()
List of parameters asString
s orSearchQuery
s.int
hashCode()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.atlassian.confluence.search.v2.SearchQuery
getBoost, getSubClauses
-
-
-
-
Field Detail
-
KEY
public static final String KEY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
LabelsQuery
public LabelsQuery(Set<String> labels)
- Parameters:
labels
- a set of labels. Namespaced labels such as "my:foo" are permitted. Required.- Throws:
IllegalArgumentException
- if labels is null
-
-
Method Detail
-
getKey
public String getKey()
- Specified by:
getKey
in interfaceSearchQuery
- Returns:
- the plugin key
-
getParameters
public List getParameters()
Description copied from interface:SearchQuery
List of parameters asString
s orSearchQuery
s.- Specified by:
getParameters
in interfaceSearchQuery
- Returns:
String
s orSearchQuery
s.
-
expand
public SearchQuery expand()
Description copied from interface:SearchQuery
Expands this query into a composite query (that composes other queries). By overriding this method, one can specify a new query that is composition of the behaviour of the composed queries.- Specified by:
expand
in interfaceExpandable<SearchQuery>
- Specified by:
expand
in interfaceSearchQuery
- Returns:
- a query
-
-