public class FlexibleSearchQuery extends AbstractQuery
The FlexibleSearchQuery stores all needed informations (the query itself, parameters, ...) to execute a search in the
FlexibleSearchService. This class provides possibility to write much more cleaner code than with manually
handling query and parameters.
...
final Map queryParams = new HashMap
Please note that this class is not thread-safe and not intended to be living longer than one request.
| Constructor and Description |
|---|
FlexibleSearchQuery(String query)
FlexibleSearchQuery constructor.
|
FlexibleSearchQuery(StringBuilder sb)
FlexibleSearchQuery constructor.
|
FlexibleSearchQuery(String query,
Map queryParams)
FlexibleSearchQuery constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addQueryParameter(String key,
Object value)
Add a query parameter to the search.
|
void |
addQueryParameters(Map<String,? extends Object> params)
Add a additional parameter map (String->Object) to the search.
|
boolean |
equals(Object obj) |
String |
getQuery() |
Map<String,Object> |
getQueryParameters() |
int |
hashCode() |
String |
toString() |
getCatalogVersions, getCount, getLanguage, getLocale, getResultClassList, getSessionSearchRestrictions, getStart, getUser, isDisableCaching, isDisableSearchRestrictions, isDisableSpecificDbLimitSupport, isFailOnUnknownFields, isNeedTotal, setCatalogVersions, setCatalogVersions, setCount, setDisableCaching, setDisableSearchRestrictions, setDisableSpecificDbLimitSupport, setFailOnUnknownFields, setLanguage, setLocale, setNeedTotal, setResultClassList, setSessionSearchRestrictions, setSessionSearchRestrictions, setStart, setUserpublic FlexibleSearchQuery(String query)
addQueryParameter(String, Object) / addQueryParameters(Map) or instead use the
constructor FlexibleSearchQuery(String, Map).query - the flexible search querypublic FlexibleSearchQuery(StringBuilder sb)
addQueryParameter(String, Object) / addQueryParameters(Map) or
instead use the constructor FlexibleSearchQuery(String, Map).sb - the StringBuilder object containing flexible search querypublic FlexibleSearchQuery(String query, Map queryParams)
query - the flexible search queryqueryParams - a Mappublic void addQueryParameter(String key, Object value)
Add a query parameter to the search. The key is referenced in the query (see getQuery()) with
?<key>
Note that:
null value is not legal parameters.
empty Collection value is not legal parameters.
key - the key of the parametervalue - the value of the parameterpublic void addQueryParameters(Map<String,? extends Object> params)
Add a additional parameter map (String->Object) to the search. Each key is referenced in the query (see
getQuery()) with ?<key>
Note that:
null value in params map is not legal.
empty Collection value in params map is not legal.
params - the mappublic String getQuery()
public Map<String,Object> getQueryParameters()
Copyright © 2017 SAP SE. All Rights Reserved.