public interface Query
Modifier and Type | Method and Description |
---|---|
Query |
facets(List<Facet> facets)
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.
|
String |
getNestedPath()
Returns the nested query path.
|
Operation |
groupedAnd(List<String> fields,
List<?> query)
Grouped AND query on multiple fields and values.
|
Operation |
groupedNot(List<String> fields,
List<?> query)
Grouped NOT query on multiple fields and values.
|
Operation |
groupedOr(List<String> fields,
List<?> query)
Grouped OR query on multiple fields and values.
|
Query |
groupEnd()
Ends group.
|
Query |
groupStart()
Starts group.
|
BooleanOperation |
id(String id)
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.
|
BooleanOperation |
itemType(String itemType)
Searches or constrains to item types.
|
BooleanOperation |
multiMatch(List<String> wildCardFieldNames,
String query)
Searches given text in the specified fields.
|
BooleanOperation |
multiMatch(List<String> wildCardFieldNames,
String query,
MatchOperation operation)
Searches given text in the specified fields with given operation.
|
BooleanOperation |
multiMatch(List<String> wildCardFieldNames,
String query,
MatchOperation operation,
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.
|
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.
|
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 operation)
Sets the operation in Query object.
|
Query groupStart() throws QueryException
QueryException
Query not()
Optional<BooleanOperationType> getBooleanOperation()
BooleanOperation id(String id) throws QueryException
id
- the idQueryException
BooleanOperation id(String sourceIdentifier, int publicationId, int itemId, int itemType) throws QueryException
sourceIdentifier
- the source identifier. Currently either
'ish' or 'tcm'publicationId
- the unique iditemId
- the unique iditemType
- the item typeQueryException
BooleanOperation multiMatch(String query) throws QueryException
query
- The text to be searched.QueryException
BooleanOperation multiMatch(List<String> wildCardFieldNames, String query) throws QueryException
query
- The text to be searched.QueryException
BooleanOperation multiMatch(List<String> wildCardFieldNames, String query, MatchOperation operation) throws QueryException
wildCardFieldNames
- The field names.query
- The text to be searched.operation
- The operation.QueryException
BooleanOperation multiMatch(List<String> wildCardFieldNames, String query, MatchOperation operation, MatchType type) throws QueryException
wildCardFieldNames
- The field names.query
- The text to be searched.operation
- The operation.type
- The type.QueryException
BooleanOperation itemType(String itemType) throws QueryException
itemType
- the item typeQueryException
BooleanOperation field(String fieldName, String fieldValue) throws QueryException
fieldName
- the field namefieldValue
- the search stringQueryException
BooleanOperation field(String fieldName, String fieldValue, boolean escapeDotsInKey) throws QueryException
fieldName
- the field namefieldValue
- the search StringescapeDotsInKey
- whether the dots in the key need to be escapedQueryException
BooleanOperation field(String fieldName, TermValue fieldValue) throws QueryException
fieldName
- the field namefieldValue
- the search stringQueryException
BooleanOperation field(String fieldName, TermValues fieldValues) throws QueryException
fieldName
- the field namefieldValues
- the search stringsQueryException
BooleanOperation field(String fieldName, Object fieldValue) throws QueryException
fieldName
- the field namefieldValue
- the search objectQueryException
BooleanOperation range(String fieldName, OffsetDateTime lower, OffsetDateTime upper) throws QueryException
fieldName
- the field namelower
- the lower (from) date.upper
- the upper (to) date.QueryException
BooleanOperation range(String fieldName, OffsetDateTime lower, OffsetDateTime upper, boolean includeLower, boolean includeUpper) throws QueryException
fieldName
- the field namelower
- the lower (from) date.upper
- the upper (to) date.QueryException
BooleanOperation range(String fieldName, Integer lower, Integer upper) throws QueryException
fieldName
- the field namelower
- the from int.upper
- the from int.QueryException
BooleanOperation range(String fieldName, Integer lower, Integer upper, boolean includeLower, boolean includeUpper) throws QueryException
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
BooleanOperation range(String fieldName, Double lower, Double upper) throws QueryException
fieldName
- the field namelower
- the from double.upper
- the from double.QueryException
BooleanOperation range(String fieldName, Double lower, Double upper, boolean includeLower, boolean includeUpper) throws QueryException
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
BooleanOperation range(String fieldName, Float lower, Float upper) throws QueryException
fieldName
- the field namelower
- the from int.upper
- the from int.QueryException
BooleanOperation range(String fieldName, Float lower, Float upper, boolean includeLower, boolean includeUpper) throws QueryException
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
BooleanOperation range(String fieldName, Long lower, Long upper) throws QueryException
fieldName
- the field namelower
- the from long.upper
- the from long.QueryException
BooleanOperation range(String fieldName, Long lower, Long upper, boolean includeLower, boolean includeUpper) throws QueryException
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
BooleanOperation range(String fieldName, String lower, String upper) throws QueryException
fieldName
- the field namelower
- the from string.upper
- the from string.QueryException
BooleanOperation range(String fieldName, String lower, String upper, boolean includeLower, boolean includeUpper) throws QueryException
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
Operation groupedAnd(List<String> fields, List<?> query) throws QueryException
Example: groupedAnd({"id","type"},{"1","page"}
becomes: +(+id:1 +type:page) List lengths must match or query param may be smaller.
fields
- the list of fields.query
- the query parametersQueryException
Operation groupedOr(List<String> fields, List<?> query) throws QueryException
Example: groupedOr({"id","type"},{"1","page"}
becomes: +(id:1 type:page) List lengths must match or query param may be smaller.
fields
- the list of fields.query
- the query parametersQueryException
Operation groupedNot(List<String> fields, List<?> query) throws QueryException
Example: groupedNot({"id","type"},{"1","page"}
becomes: (-id:1 -type:page) List lengths must match or query param may be smaller.
fields
- the list of fields.query
- the query parametersQueryException
Query withOperation(BooleanOperation operation)
operation
- The operation.Query sortFieldsDescending(List<String> fieldNames)
fieldNames
- The fields.Query sortFieldsAscending(List<String> fieldNames)
fieldNames
- The fields.Query sortStringFieldsDescending(List<String> fieldNames)
fieldNames
- The fields.Query sortStringFieldsAscending(List<String> fieldNames)
fieldNames
- The fields.Query groupEnd() throws QueryException
QueryException
Query facets(List<Facet> facets)
facets
- The facets.boolean isNested()
String getNestedPath()
Copyright (c) 2014-2021 All Rights Reserved by the RWS Group for and on behalf of its affiliates and subsidiaries