| 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
QuerygroupStart in interface QueryQueryExceptionpublic Optional<BooleanOperationType> getBooleanOperation()
QuerygetBooleanOperation in interface Querypublic BooleanOperation id(String idString) throws QueryException
Queryid in interface QueryidString - the idQueryExceptionpublic BooleanOperation id(String sourceIdentifier, int publicationId, int itemId, int itemType) throws QueryException
Queryid in interface QuerysourceIdentifier - the source identifier. Currently either
'ish' or 'tcm'publicationId - the unique iditemId - the unique iditemType - the item typeQueryExceptionpublic BooleanOperation multiMatch(String query) throws QueryException
QuerymultiMatch in interface Queryquery - The text to be searched.QueryExceptionpublic BooleanOperation multiMatch(List<String> wildCardFieldNames, String query) throws QueryException
QuerymultiMatch in interface Queryquery - The text to be searched.QueryExceptionpublic BooleanOperation multiMatch(List<String> wildCardFieldNames, String query, MatchOperation matchOperation) throws QueryException
QuerymultiMatch in interface QuerywildCardFieldNames - The field names.query - The text to be searched.matchOperation - The operation.QueryExceptionpublic BooleanOperation multiMatch(List<String> wildCardFieldNames, String query, MatchOperation matchOperation, MatchType type) throws QueryException
QuerymultiMatch in interface QuerywildCardFieldNames - The field names.query - The text to be searched.matchOperation - The operation.type - The type.QueryExceptionpublic BooleanOperation itemType(String itemType) throws QueryException
QueryitemType in interface QueryitemType - the item typeQueryExceptionpublic BooleanOperation field(String fieldName, String fieldValue) throws QueryException
Queryfield in interface QueryfieldName - the field namefieldValue - the search stringQueryExceptionpublic BooleanOperation field(String fieldName, String fieldValue, boolean escapeDotsInKey) throws QueryException
Queryfield in interface QueryfieldName - the field namefieldValue - the search StringescapeDotsInKey - whether the dots in the key need to be escapedQueryExceptionpublic BooleanOperation field(String fieldName, TermValue fieldValue) throws QueryException
Queryfield in interface QueryfieldName - the field namefieldValue - the search stringQueryExceptionpublic BooleanOperation field(String fieldName, TermValues fieldValues) throws QueryException
Queryfield in interface QueryfieldName - the field namefieldValues - the search stringsQueryExceptionpublic BooleanOperation field(String fieldName, Object fieldValue) throws QueryException
Queryfield in interface QueryfieldName - the field namefieldValue - the search objectQueryExceptionpublic BooleanOperation range(String fieldName, OffsetDateTime lower, OffsetDateTime upper) throws QueryException
Queryrange in interface QueryfieldName - the field namelower - the lower (from) date.upper - the upper (to) date.QueryExceptionpublic BooleanOperation range(String fieldName, OffsetDateTime lower, OffsetDateTime upper, boolean includeLower, boolean includeUpper) throws QueryException
Queryrange in interface QueryfieldName - the field namelower - the lower (from) date.upper - the upper (to) date.QueryExceptionpublic BooleanOperation range(String fieldName, Integer lower, Integer upper) throws QueryException
Queryrange in interface QueryfieldName - the field namelower - the from int.upper - the from int.QueryExceptionpublic BooleanOperation range(String fieldName, Integer lower, Integer upper, boolean includeLower, boolean includeUpper) throws QueryException
Queryrange in interface QueryfieldName - the field namelower - the from int.upper - the from int.includeLower - boolean to include the lower range.includeUpper - boolean to include the upper range.QueryExceptionpublic BooleanOperation range(String fieldName, Double lower, Double upper) throws QueryException
Queryrange in interface QueryfieldName - the field namelower - the from double.upper - the from double.QueryExceptionpublic BooleanOperation range(String fieldName, Double lower, Double upper, boolean includeLower, boolean includeUpper) throws QueryException
Queryrange in interface QueryfieldName - the field namelower - the from double.upper - the from double.includeLower - boolean to include the lower range.includeUpper - boolean to include the upper range.QueryExceptionpublic BooleanOperation range(String fieldName, Float lower, Float upper) throws QueryException
Queryrange in interface QueryfieldName - the field namelower - the from int.upper - the from int.QueryExceptionpublic BooleanOperation range(String fieldName, Float lower, Float upper, boolean includeLower, boolean includeUpper) throws QueryException
Queryrange in interface QueryfieldName - the field namelower - the from float.upper - the from float.includeLower - boolean to include the lower range.includeUpper - boolean to include the upper range.QueryExceptionpublic BooleanOperation range(String fieldName, Long lower, Long upper) throws QueryException
Queryrange in interface QueryfieldName - the field namelower - the from long.upper - the from long.QueryExceptionpublic BooleanOperation range(String fieldName, Long lower, Long upper, boolean includeLower, boolean includeUpper) throws QueryException
Queryrange in interface QueryfieldName - the field namelower - the from long.upper - the from long.includeLower - boolean to include the lower range.includeUpper - boolean to include the upper range.QueryExceptionpublic BooleanOperation range(String fieldName, String lower, String upper) throws QueryException
Queryrange in interface QueryfieldName - the field namelower - the from string.upper - the from string.QueryExceptionpublic BooleanOperation range(String fieldName, String lower, String upper, boolean includeLower, boolean includeUpper) throws QueryException
Queryrange in interface QueryfieldName - the field namelower - the from string.upper - the from string.includeLower - boolean to include the lower range.includeUpper - boolean to include the upper range.QueryExceptionpublic BooleanOperation groupedAnd(List<String> fields, List<?> query) throws QueryException
QueryExample: groupedAnd({"id","type"},{"1","page"}
becomes: +(+id:1 +type:page) List lengths must match or query param may be smaller.
groupedAnd in interface Queryfields - the list of fields.query - the query parametersQueryExceptionpublic BooleanOperation groupedOr(List<String> fields, List<?> query) throws QueryException
QueryExample: groupedOr({"id","type"},{"1","page"}
becomes: +(id:1 type:page) List lengths must match or query param may be smaller.
groupedOr in interface Queryfields - the list of fields.query - the query parametersQueryExceptionpublic BooleanOperation groupedNot(List<String> fields, List<?> query) throws QueryException
QueryExample: groupedNot({"id","type"},{"1","page"}
becomes: (-id:1 -type:page) List lengths must match or query param may be smaller.
groupedNot in interface Queryfields - the list of fields.query - the query parametersQueryExceptionpublic Query groupEnd() throws QueryException
QuerygroupEnd in interface QueryQueryExceptionpublic Query sortFieldsAscending(List<String> fieldNames)
QuerysortFieldsAscending in interface QueryfieldNames - The fields.public Query sortFieldsDescending(List<String> fieldNames)
QuerysortFieldsDescending in interface QueryfieldNames - The fields.public Query sortStringFieldsAscending(List<String> fieldNames)
QuerysortStringFieldsAscending in interface QueryfieldNames - The fields.public Query sortStringFieldsDescending(List<String> fieldNames)
QuerysortStringFieldsDescending in interface QueryfieldNames - The fields.public Query withOperation(BooleanOperation op)
QuerywithOperation in interface Queryop - The operation.public Query facets(List<Facet> fieldNames)
Querypublic boolean hasFacets()
public boolean isNested()
Querypublic String getNestedPath()
QuerygetNestedPath in interface Querypublic 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