Search client
The Search client in the Web SDK enables developers to perform powerful and flexible search operations on entities. It supports full-text search, filtering, sorting, pagination, and localization.
The following methods are available.
SearchAsync
Performs a search for entities using a SearchRequest object that supports a wide range of filtering, sorting, and configuration options.
The parameters you can use with the SearchAsync method are detailed in the following table.
|
Property |
Type |
Description |
|---|---|---|
|
|
string |
The search query string. |
|
|
string |
Template for logical grouping. |
|
|
string |
Default search configuration. |
|
|
string |
Configuration category. |
|
|
long |
Component ID. |
|
|
CultureInfo |
Culture info (defaults to |
|
|
SortingRequestResource |
Sorting expression. |
|
|
IDictionary<string, int> |
Custom sorting. |
|
|
int |
Records to skip (pagination). |
|
|
int |
Records to take (pagination, default is 25). |
|
|
List |
Filters to apply. |
|
|
List |
Full-text filters. |
|
|
List |
Fields to include in results. |
|
|
long |
Saved selection ID. |
|
|
string |
View type for results. |
|
|
DateTime |
Calendar filter start date. |
|
|
DateTime |
Calendar filter stop date. |
|
|
SelectionPoolFilterResource |
Selection pool filter. |
|
|
List |
Aggregation requests. |
|
|
IEnumerable |
Nested relations to include. |
|
|
SearchGroupRequestResource |
Grouping request. |
|
|
bool |
Indicates if this is the initial request. |
|
|
bool |
Use user settings. |
|
|
bool |
Use localization. |
|
|
VisualSearchRequestResource |
Visual search request. |
|
|
IDictionary |
Additional extension data. |
The following code provides a full-text search example.
GetAllFacetValuesAsync
Retrieves all available values for a specified facet field using an AllFacetsRequest.
The parameters you can use with the GetAllFacetValuesAsync method are detailed in the following table.
|
Property |
Type |
Description |
|---|---|---|
|
|
string |
Name of the facet field. |
|
|
string |
Optional query for facet values. |
|
|
string |
Name of the search configuration. |
|
|
CultureInfo |
Culture for facet values. |
|
|
long |
Component ID. |
|
|
IList |
Filters to apply. |
|
|
bool |
Use user settings. |
|
|
bool |
Use localization. |
|
|
int |
Records to skip (pagination). |
|
|
int |
Records to take (pagination). |
The following code provides an example of how to get facet values.
Exceptions
-
ArgumentNullException– if the request is null. -
ArgumentOutOfRangeException– ifTakeorSkipis negative. -
ArgumentException– if any filter or culture is invalid.