A configurable request for the cross-application "omni search" used by the admin search box. Create one with SearchManager.newOmniSearchRequest, narrow it down with the fluent excludeType, includeType and applyGroupFilter methods, then pass it to SearchManager.omniSearch or SearchManager.omniSearchAggs to run it. Each active OmniSearchApplication contributes its own query clause and output fields when the request is executed.
Properties
| Property | Returns | Description |
|---|---|---|
| excludedTypes | List<String> | The item types excluded from the search results, or null if no types have been excluded. |
| phrase | String | The search phrase this request matches against, already trimmed and lower-cased, or null if no phrase was given. |
Methods
applyGroupFilter(boolean b)
Returns: OmniSearchRequest
Sets whether results should be filtered to the current user's groups. Note this flag is currently not applied by the query built in this request.
| Parameter | Description |
|---|---|
b | true to restrict results to the current user's groups, false to leave them unrestricted |
getPhrase()
Returns: String
The search phrase this request matches against, already trimmed and lower-cased, or null if no phrase was given.
getExcludedTypes()
Returns: List<String>
The item types excluded from the search results, or null if no types have been excluded.
excludedTypes(List<String> list)
Returns: OmniSearchRequest
Replaces the full list of item types to exclude from the search results.
| Parameter | Description |
|---|---|
list | the item types to exclude, replacing any types set previously |
excludeType(String s)
Returns: OmniSearchRequest
Adds a single item type to exclude from the search results.
| Parameter | Description |
|---|---|
s | the item type to exclude |
includeType(String s)
Returns: OmniSearchRequest
Adds a single item type to include in the search results. Used together with parseTerms to build the type filter from request parameters.
| Parameter | Description |
|---|---|
s | the item type to include |
parseTerms(Map<String,String> params)
Returns: OmniSearchRequest
Reads item type filters from request parameters named "term-itemType" (types to include) and "exterm-itemType" (types to exclude), as used by URLs like /contentSearch?q=some&term-itemType=module,modulePage, and applies them to this request via includeType and excludeType.
| Parameter | Description |
|---|---|
params | the request parameters to read filter terms from |