- Clients
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 |
|---|---|---|
Query | string | The search query string. |
LogicalGroupingTemplate | string | Template for logical grouping. |
SearchDefaults | string | Default search configuration. |
ConfigurationCategory | string | Configuration category. |
ComponentId | long | Component ID. |
Culture | CultureInfo | Culture info (defaults to InvariantCulture). |
Sorting | SortingRequestResource | Sorting expression. |
CustomSorting | IDictionary<string, int> | Custom sorting. |
Skip | int | Records to skip (pagination). |
Take | int | Records to take (pagination, default is 25). |
Filters | List<FieldFilterRequestResource> | Filters to apply. |
FullTextFilters | List<string> | Full-text filters. |
Fields | List<string> | Fields to include in results. |
SavedSelection | long | Saved selection ID. |
View | string | View type for results. |
CalendarStartDate | DateTime | Calendar filter start date. |
CalendarStopDate | DateTime | Calendar filter stop date. |
SelectionPool | SelectionPoolFilterResource | Selection pool filter. |
Aggregations | List<AggregationRequestResource> | Aggregation requests. |
NestedRelations | IEnumerable<NestedRelationInfo> | Nested relations to include. |
Group | SearchGroupRequestResource | Grouping request. |
IsInitialRequest | bool | Indicates if this is the initial request. |
TakeUserSettings | bool | Use user settings. |
L10N | bool | Use localization. |
VisualSearch | VisualSearchRequestResource | Visual search request. |
ExtensionData | IDictionary<string, JToken> | 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 |
|---|---|---|
FacetFieldName | string | Name of the facet field. |
Query | string | Optional query for facet values. |
SearchConfigurationName | string | Name of the search configuration. |
Culture | CultureInfo | Culture for facet values. |
ComponentId | long | Component ID. |
Filters | IList<FieldFilterRequestResource> | Filters to apply. |
TakeUserSettings | bool | Use user settings. |
L10N | bool | Use localization. |
Skip | int | Records to skip (pagination). |
Take | 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.