Modifier and Type | Method and Description |
---|---|
Query |
facets(List<Facet> fieldNames)
Sets the facets.
|
BooleanOperation |
field(String fieldName,
Object fieldValue)
Default text query on a field.
|
BooleanOperation |
field(String fieldName,
String fieldValue)
Default text query on a field.
|
BooleanOperation |
field(String fieldName,
String fieldValue,
boolean escapeDotsInKey)
Default text query on a field with the option to escape the dots in the key.
|
BooleanOperation |
field(String fieldName,
TermValue fieldValue)
Default text query on a field.
|
BooleanOperation |
field(String fieldName,
TermValues fieldValues)
Alternative text queries on a field.
|
Optional<BooleanOperationType> |
getBooleanOperation()
Gets the current boolean operation of this Query.
|
List<Facet> |
getFacets() |
String |
getNestedPath()
Returns the nested query path.
|
Optional<List<String>> |
getSortFields() |
BooleanOperation |
groupedAnd(List<String> fields,
List<?> query)
Grouped AND query on multiple fields and values.
|
BooleanOperation |
groupedNot(List<String> fields,
List<?> query)
Grouped NOT query on multiple fields and values.
|
BooleanOperation |
groupedOr(List<String> fields,
List<?> query)
Grouped OR query on multiple fields and values.
|
Query |
groupEnd()
Ends group.
|
Query |
groupStart()
Starts group.
|
boolean |
hasFacets() |
BooleanOperation |
id(String idString)
Searches for an Id.
|
BooleanOperation |
id(String sourceIdentifier,
int publicationId,
int itemId,
int itemType)
Searches for an Id, separating the identifiers as int.
|
boolean |
isNested()
Returns true if query is marked as a nested query.
|
boolean |
isSortDescending() |
boolean |
isSortStrings() |
BooleanOperation |
itemType(String itemType)
Searches or constrains to item types.
|
SearchNode |
left() |
BooleanOperation |
multiMatch(List<String> wildCardFieldNames,
String query)
Searches given text in the specified fields.
|
BooleanOperation |
multiMatch(List<String> wildCardFieldNames,
String query,
MatchOperation matchOperation)
Searches given text in the specified fields with given operation.
|
BooleanOperation |
multiMatch(List<String> wildCardFieldNames,
String query,
MatchOperation matchOperation,
MatchType type)
Searches given text in the specified fields with given operation and type.
|
BooleanOperation |
multiMatch(String query)
Searches given text in both content and dynamically indexed fields with the following syntax:
"content.*","dynamic.*"
The query operator is OR.
|
static Query |
newNestedQuery(String nestedPath) |
static Query |
newQuery() |
Query |
not()
Used to invert (boolean) a node.
|
BooleanOperation |
range(String fieldName,
Double lower,
Double upper)
Query on a double range.
|
BooleanOperation |
range(String fieldName,
Double lower,
Double upper,
boolean includeLower,
boolean includeUpper)
Query on a double range, with the option to include the lower and upper bounds.
|
BooleanOperation |
range(String fieldName,
Float lower,
Float upper)
Query on an float range.
|
BooleanOperation |
range(String fieldName,
Float lower,
Float upper,
boolean includeLower,
boolean includeUpper)
Query on a float range, with the option to include the lower and upper bounds.
|
BooleanOperation |
range(String fieldName,
Integer lower,
Integer upper)
Query on an int range.
|
BooleanOperation |
range(String fieldName,
Integer lower,
Integer upper,
boolean includeLower,
boolean includeUpper)
Query on an int range, with the option to include the lower and upper bounds.
|
BooleanOperation |
range(String fieldName,
Long lower,
Long upper)
Query on an long range.
|
BooleanOperation |
range(String fieldName,
Long lower,
Long upper,
boolean includeLower,
boolean includeUpper)
Query on a long range, with the option to include the lower and upper bounds.
|
BooleanOperation |
range(String fieldName,
OffsetDateTime lower,
OffsetDateTime upper)
Query on date range.
|
BooleanOperation |
range(String fieldName,
OffsetDateTime lower,
OffsetDateTime upper,
boolean includeLower,
boolean includeUpper)
Query on date range, with the option to include the lower and upper bounds.
|
BooleanOperation |
range(String fieldName,
String lower,
String upper)
Query on an string range.
|
BooleanOperation |
range(String fieldName,
String lower,
String upper,
boolean includeLower,
boolean includeUpper)
Query on a string range, with the option to include the lower and upper bounds.
|
SearchNode |
right() |
Query |
sortFieldsAscending(List<String> fieldNames)
Sets sort fields.
|
Query |
sortFieldsDescending(List<String> fieldNames)
Sets descending sort fields.
|
Query |
sortStringFieldsAscending(List<String> fieldNames)
Sets sort fields having string type.
|
Query |
sortStringFieldsDescending(List<String> fieldNames)
Sets descending sort fields having string type.
|
Query |
withOperation(BooleanOperation op)
Sets the operation in Query object.
|
public static Query newQuery()
public Query groupStart() throws QueryException
Query
groupStart
in interface Query
QueryException
public Optional<BooleanOperationType> getBooleanOperation()
Query
getBooleanOperation
in interface Query
public BooleanOperation id(String idString) throws QueryException
Query
id
in interface Query
idString
- the idQueryException
public BooleanOperation id(String sourceIdentifier, int publicationId, int itemId, int itemType) throws QueryException
Query
id
in interface Query
sourceIdentifier
- the source identifier. Currently either
'ish' or 'tcm'publicationId
- the unique iditemId
- the unique iditemType
- the item typeQueryException
public BooleanOperation multiMatch(String query) throws QueryException
Query
multiMatch
in interface Query
query
- The text to be searched.QueryException
public BooleanOperation multiMatch(List<String> wildCardFieldNames, String query) throws QueryException
Query
multiMatch
in interface Query
query
- The text to be searched.QueryException
public BooleanOperation multiMatch(List<String> wildCardFieldNames, String query, MatchOperation matchOperation) throws QueryException
Query
multiMatch
in interface Query
wildCardFieldNames
- The field names.query
- The text to be searched.matchOperation
- The operation.QueryException
public BooleanOperation multiMatch(List<String> wildCardFieldNames, String query, MatchOperation matchOperation, MatchType type) throws QueryException
Query
multiMatch
in interface Query
wildCardFieldNames
- The field names.query
- The text to be searched.matchOperation
- The operation.type
- The type.QueryException
public BooleanOperation itemType(String itemType) throws QueryException
Query
itemType
in interface Query
itemType
- the item typeQueryException
public BooleanOperation field(String fieldName, String fieldValue) throws QueryException
Query
field
in interface Query
fieldName
- the field namefieldValue
- the search stringQueryException
public BooleanOperation field(String fieldName, String fieldValue, boolean escapeDotsInKey) throws QueryException
Query
field
in interface Query
fieldName
- the field namefieldValue
- the search StringescapeDotsInKey
- whether the dots in the key need to be escapedQueryException
public BooleanOperation field(String fieldName, TermValue fieldValue) throws QueryException
Query
field
in interface Query
fieldName
- the field namefieldValue
- the search stringQueryException
public BooleanOperation field(String fieldName, TermValues fieldValues) throws QueryException
Query
field
in interface Query
fieldName
- the field namefieldValues
- the search stringsQueryException
public BooleanOperation field(String fieldName, Object fieldValue) throws QueryException
Query
field
in interface Query
fieldName
- the field namefieldValue
- the search objectQueryException
public BooleanOperation range(String fieldName, OffsetDateTime lower, OffsetDateTime upper) throws QueryException
Query
range
in interface Query
fieldName
- the field namelower
- the lower (from) date.upper
- the upper (to) date.QueryException
public BooleanOperation range(String fieldName, OffsetDateTime lower, OffsetDateTime upper, boolean includeLower, boolean includeUpper) throws QueryException
Query
range
in interface Query
fieldName
- the field namelower
- the lower (from) date.upper
- the upper (to) date.QueryException
public BooleanOperation range(String fieldName, Integer lower, Integer upper) throws QueryException
Query
range
in interface Query
fieldName
- the field namelower
- the from int.upper
- the from int.QueryException
public BooleanOperation range(String fieldName, Integer lower, Integer upper, boolean includeLower, boolean includeUpper) throws QueryException
Query
range
in interface Query
fieldName
- the field namelower
- the from int.upper
- the from int.includeLower
- boolean to include the lower range.includeUpper
- boolean to include the upper range.QueryException
public BooleanOperation range(String fieldName, Double lower, Double upper) throws QueryException
Query
range
in interface Query
fieldName
- the field namelower
- the from double.upper
- the from double.QueryException
public BooleanOperation range(String fieldName, Double lower, Double upper, boolean includeLower, boolean includeUpper) throws QueryException
Query
range
in interface Query
fieldName
- the field namelower
- the from double.upper
- the from double.includeLower
- boolean to include the lower range.includeUpper
- boolean to include the upper range.QueryException
public BooleanOperation range(String fieldName, Float lower, Float upper) throws QueryException
Query
range
in interface Query
fieldName
- the field namelower
- the from int.upper
- the from int.QueryException
public BooleanOperation range(String fieldName, Float lower, Float upper, boolean includeLower, boolean includeUpper) throws QueryException
Query
range
in interface Query
fieldName
- the field namelower
- the from float.upper
- the from float.includeLower
- boolean to include the lower range.includeUpper
- boolean to include the upper range.QueryException
public BooleanOperation range(String fieldName, Long lower, Long upper) throws QueryException
Query
range
in interface Query
fieldName
- the field namelower
- the from long.upper
- the from long.QueryException
public BooleanOperation range(String fieldName, Long lower, Long upper, boolean includeLower, boolean includeUpper) throws QueryException
Query
range
in interface Query
fieldName
- the field namelower
- the from long.upper
- the from long.includeLower
- boolean to include the lower range.includeUpper
- boolean to include the upper range.QueryException
public BooleanOperation range(String fieldName, String lower, String upper) throws QueryException
Query
range
in interface Query
fieldName
- the field namelower
- the from string.upper
- the from string.QueryException
public BooleanOperation range(String fieldName, String lower, String upper, boolean includeLower, boolean includeUpper) throws QueryException
Query
range
in interface Query
fieldName
- the field namelower
- the from string.upper
- the from string.includeLower
- boolean to include the lower range.includeUpper
- boolean to include the upper range.QueryException
public BooleanOperation groupedAnd(List<String> fields, List<?> query) throws QueryException
Query
Example: groupedAnd({"id","type"},{"1","page"}
becomes: +(+id:1 +type:page) List lengths must match or query param may be smaller.
groupedAnd
in interface Query
fields
- the list of fields.query
- the query parametersQueryException
public BooleanOperation groupedOr(List<String> fields, List<?> query) throws QueryException
Query
Example: groupedOr({"id","type"},{"1","page"}
becomes: +(id:1 type:page) List lengths must match or query param may be smaller.
groupedOr
in interface Query
fields
- the list of fields.query
- the query parametersQueryException
public BooleanOperation groupedNot(List<String> fields, List<?> query) throws QueryException
Query
Example: groupedNot({"id","type"},{"1","page"}
becomes: (-id:1 -type:page) List lengths must match or query param may be smaller.
groupedNot
in interface Query
fields
- the list of fields.query
- the query parametersQueryException
public Query groupEnd() throws QueryException
Query
groupEnd
in interface Query
QueryException
public Query sortFieldsAscending(List<String> fieldNames)
Query
sortFieldsAscending
in interface Query
fieldNames
- The fields.public Query sortFieldsDescending(List<String> fieldNames)
Query
sortFieldsDescending
in interface Query
fieldNames
- The fields.public Query sortStringFieldsAscending(List<String> fieldNames)
Query
sortStringFieldsAscending
in interface Query
fieldNames
- The fields.public Query sortStringFieldsDescending(List<String> fieldNames)
Query
sortStringFieldsDescending
in interface Query
fieldNames
- The fields.public Query withOperation(BooleanOperation op)
Query
withOperation
in interface Query
op
- The operation.public Query facets(List<Facet> fieldNames)
Query
public boolean hasFacets()
public boolean isNested()
Query
public String getNestedPath()
Query
getNestedPath
in interface Query
public boolean isSortStrings()
public boolean isSortDescending()
public SearchNode left()
public SearchNode right()
Copyright (c) 2014-2021 All Rights Reserved by the RWS Group for and on behalf of its affiliates and subsidiaries