Search policies
Version:
The Sitecore.Commerce.Plugin.Search.SearchPolicy contributes configuration policies that define common settings applicable to multiple search providers.
Note
Do not extend or inherit from out-of-the-box policies; instead, create your own.
You can change the values of default policies by modifying the PolicySet JSON or the Environment JSON, depending on where the policy is defined, and then re-running Bootstrap.
The following policies can be configured through the Search plugin:
| Policy | Description | Properties / Default Values |
|---|---|---|
IndexablePolicy | Defines which View fields to index for a particular entity. Each indexable EntityType can have an IndexableView that the Commerce Engine retrieves to determine which entity properties to index. For a specific view, each ViewProperty (i.e., field) must have an Indexable policy that defines the settings for the index, which fields the index has, their type, whether they are searchable, filterable, and so on. Each field to be indexed must have the following properties defined in the Indexable policy:
The indexing blocks use the values set for the field’s properties to build the index and update/insert documents into the index. Note The isKey property can only be set to true for one field. If multiple fields have the isKey property set to true, validation fails when the minion creates or updates the index. | SearchScopeName <br> Properties \ ConcurrentDictionary<string, IndexableSettings> |
ItemIndexablePolicy | Defines the field type mappers. | |
KnownSearchActionsPolicy | Defines the names of the search view actions. | Search \ "Search" DeleteSearchIndex "DeleteSearchIndex" UpdateSearchIndex "UpdateSearchIndex" CreateSearchIndex "CreateSearchIndex" |
KnownSearchViewsPolicy | Defines the names of the search views. | Documents \ "Documents" Document \ "Document" Search \ "Search" SearchResults "SearchResults" SearchResult \ "SearchResult" Indexes \ "Indexes" Index \ "Index" |
SearchScopePolicy | Defines the type of entity to be added to the index. Indexing minions use the SearchScope policy to ensure that the appropriate entity types are put into indexable lists. When commerce entities are persisted, the index minion checks the entity type against the Search Scope policy. If the policy specifies the relevant entity type, the minion adds the entity to the incremental list specified in the policy.The policy also defines a set of tags that can be used to add or remove data from the search results, and specifies the list to watch for updates to the entity. | Name <br> IncrementalListName <br> FullListName <br> EntityTypeNames <br> DeletedListName <br> ResultDetailsTags \List |
SearchViewPolicy | Defines the settings for the search and search results entity views. When a view is requested, a block in the IGetEntityViewPipeline checks for a SearchViewPolicy for the requested view. If a SearchViewPolicy is found, the pipeline adds the search view as a child of the requested view. | SearchScopeName <br> ViewName <br> PageSize \ 10 PageSizeOptions \ List |
SitecoreItemRebuildIndexNamePolicy | Defines the index name to use to rebuild sitecore indexes | |
SitecoreItemSearchScopePolicy | Defines whether the index is the master index or not. | IsMasterIndex (bool.) |
AzureDataTypeMap | Maps system types to Azure DataTypes. | |
AzureSearchPolicy | Defines the search policy for the Azure search provider. | SearchServiceName/ SearchServiceAdminApiKey/ SearchServiceQueryApiKey/ |
SolrSearchPolicy | Defines the search policy for the SOLR search provider. | IsSolrCloud<br> SolrDateTimeFormatString<br> ConnectionTimeout<br> UseSolrAuthentication<br> SolrUserName<br> SolrPassword\ |
If you have suggestions for improving this article, let us know!