Dev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubNuGetDev CommunitySubmit a ticketLog In
GitHubNuGetDev CommunitySubmit a ticket


## CategoryIndexerPipeline

### CreateElasticsearchCategory

OrderPipeDescription
100CreateElasticsearchCategoryCreate a new ElasticsearchCategory object using the parameter object's fields and assigns it to result.ElasticsearchCategory.

### GetIndexableCategories

OrderPipeDescription
100GetIndexableCategoriesQueryCreates an Entity Framework Category query using the parameter object's fields and assigns it to result.IndexableCategories.

### MapElasticSearchCategoryProperty

OrderPipeDescription
100MapElasticSearchCategoryCustomPropertiesIf the parameter.SearchBoost.IsQueryable is true and parameter.PropertyDefinition.IsCustomProperty is true sets result.Property to a new Nest TextProperty.

## CategorySearchPipeline

### RunCategorySearch

<table class="TableStyle-Borders" style="margin-left: 0; margin-right: auto; width: 100%;" data-cellspacing="0"> <colgroup> <col style="width: 33%" /> <col style="width: 33%" /> <col style="width: 33%" /> </colgroup> <thead> <tr class="header TableStyle-Borders-Head-Header1"> <th class="TableStyle-Borders-HeadE-Regular-Header1">Order</th> <th class="TableStyle-Borders-HeadE-Regular-Header1">Pipe</th> <th class="TableStyle-Borders-HeadD-Regular-Header1">Description</th> </tr> </thead> <tbody> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">100</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">InitializeSearchProperties</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">Retrieves the current SiteContext, ElasticsearchIndex and ElasticsearchQueryBuilder and assigns them to the result object.</td> </tr> <tr class="even TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">200</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">GetSettings</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">Retrieves SearchGeneralSettings and FuzzySearchSettings and assigns them to the result object.</td> </tr> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">300</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">GetQueryFields</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">Assigns the result.CategorySearchFields object with the fields that are queryable.</td> </tr> <tr class="even TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">400</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">FormPaging</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">Assigns result.StartRow and result.PageSize from the parameter object.</td> </tr> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">500</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">FormCategoryExcludeList</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">Finds the disallowed categories for the current user (using the FormProductFilter pipeline) and caches this value. The value is then assigned to result.DisallowedCategories.</td> </tr> <tr class="even TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">600</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">FormCategoryExcludeFilter</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">If there are any disallowedCategories adds a new negated Terms query to result.AllFilters using result.DisallowedCategories on the categoryId field.</td> </tr> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">700</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">FormLanguageFilter</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">Adds a new MatchQuery using the result.SiteContext.LanguageDto.LanguageCode on the languageCode field to result.AllFilters.</td> </tr> <tr class="even TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">800</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">FormWebsiteFilter</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">Adds a new MatchQuery using the result.SiteContext.WebsiteDto.Id on the websiteId field to result.AllFilters.</td> </tr> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">900</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">CombineFilters</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">Creates a BooleanQuery (AND) of all filters in result.AllFilters and assigns it to result.CombinedFilter.</td> </tr> <tr class="even TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">1000</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">FormMainSearchQuery</td> <td class="TableStyle-Borders-BodyD-Regular-Row1"><p>Creates a MultiMatchQuery of type CrossFields using parameter.Criteria and result.CategorySearchFields and apply boosts.</p> <p>Creates a MultimatchQuery of type PhrasePrefix using parameter.Criteria and result.CategorySearchFields and apply boosts.</p> <p>Adds both of these queries to result.AllQueries.</p></td> </tr> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">1100</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">FormFuzzySearchQuerry</td> <td class="TableStyle-Borders-BodyD-Regular-Row1"><p>If fuzzy search is enabled, creates a MultiMatchQuery with fuzziness set to FuzzySearchSettings.MaxEdits using parameter.Criteria and result.CategorySearchFields and apply boosts.</p> <p>Adds this query to result.AllQueries.</p></td> </tr> <tr class="even TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1"><p>1200</p></td> <td class="TableStyle-Borders-BodyE-Regular-Row1">CombineQueries</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">Creates a BooleanQuery (OR) of all queries in result.AllQueries and assigns it to result.CombinedQuery.</td> </tr> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">1300</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">ApplyQueryAndFilter</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">Creates a SearchDescriptor with a FunctionScore query using result.CombinedQuery and result.CombinedFilter, with a FieldValueFactor function using the boost field and assign it to result.SearchDescriptor.</td> </tr> <tr class="even TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">1400</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">ApplyPaging</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">Sets result.SearchDescriptor's From and Size variables using result.StartRow and result.PageSize.</td> </tr> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">1500</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">ApplySortOrder</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">Sets result.SearchDescriptor's sort to sort on the sortOrder field in descending order then on _score in descending order.</td> </tr> <tr class="even TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">1600</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">PerformSearch</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">Uses result.ElasticsearchIndex.Client to call Elasticsearch using result.SearchDescriptor and assigns the result to result.SearchResponse.</td> </tr> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyB-Regular-Row1">1700</td> <td class="TableStyle-Borders-BodyB-Regular-Row1">ProcessSearchResponse</td> <td class="TableStyle-Borders-BodyA-Regular-Row1">If result.SearchResponse is not null and is valid, creates a new CategorySearchResult with the search result count and an IEnumerable of CategorySearchResultDto objects using result.SearchResponse.Documents then assigns this to result.CategorySearchResult.</td> </tr> </tbody> </table>

## ContentIndexerPipeline

### CreateElasticsearchContent

<table class="TableStyle-Borders" style="margin-left: 0; margin-right: auto; width: 100%;" data-cellspacing="0"> <colgroup> <col style="width: 33%" /> <col style="width: 33%" /> <col style="width: 33%" /> </colgroup> <thead> <tr class="header TableStyle-Borders-Head-Header1"> <th class="TableStyle-Borders-HeadE-Regular-Header1">Order</th> <th class="TableStyle-Borders-HeadE-Regular-Header1">Pipe</th> <th class="TableStyle-Borders-HeadD-Regular-Header1">Description</th> </tr> </thead> <tbody> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyB-Regular-Row1">100</td> <td class="TableStyle-Borders-BodyB-Regular-Row1">CreateElasticsearchContent</td> <td class="TableStyle-Borders-BodyA-Regular-Row1"><p>Creates a new ElasticsearchContent using the parameter object's fields and assigns it to result.ElasticsearchContent.</p> <p>Fields that vary based on language, persona are populated by filtering parameter.IndexableContentItem.Fields for the field with the appropriate context.</p></td> </tr> </tbody> </table>

### GetIndexableContentItems

OrderPipeDescription
100GetIndexableContentItemQueryCreates an Entity Framework IndexableContentItem query using the parameter object's fields and assigns it to result.IndexableContentItems.

## ContentSearchPipeline

### RunContentSearch

OrderPipeDescription
100ValidatePageSizeSets result.PageSize based on parameter.PageSize, if it is less than or equal to zero set to 10, if it is greater than 1000 set to 1000 or else set to parameter.PageSize.
200FormQueryCreates a BooleanQuery (OR) of two MultiMatchQuery queries for the content fields (title, body, metaDescription, and metaKeywords) one of type CrossFields and one of type PhrasePrefix and assigns it to result.Query.
300FormFilterCreates a BooleanQuery (AND) of TermQueries to filter on website, language, deviceType, persona and not restricted pages and assigns it to result.Filter.
400PerformSearchCreates a new SearchRequest using result.Query, result.Filter and result.PageSize, then performs the search and assigns the response to result.SearchResponse.
500ProcessSearchResponseCreates an IEnumerable of ContentSearchResultsDto from the result.SearchResponse.Document fields (title, pageType, and URL) and assigns it to result.ContentSearchResults.

## ProductIndexerPipeline

### CreateElasticsearchProduct

OrderPipeDescription
100CreateElasticsearchProductCreate a new ElasticsearchProduct object using the parameter object's fields and assigns it to result.ElasticsearchProduct.
200SetSpellingCorrectionJoins ElasticseachProduct fields (ShortDescription, Content, ManufacturuerItem, Name, Specifications, ErpNumber, CategoryNames, and FilterNames) into a string and assigns it to result.ElasticsearchProduct.SpellingCorrection.

### GetIndexableProducts

OrderPipeDescription
100GetIndexableProductsSqlStatementPartsCreates a string with the <<product-name>> default SQL query to get the correct products and fields from the database and assigns it to result.SqlStatement.Assigns result.IncremenalFilter with the proper SQL snippet if parameter.IsIncremental is true.
200CombineIndexableProductsSqlStatementPartsCombines result.SqlStatement, result.CustomFields, and result.IncrementalFilter and assigns it to result.FormattedSqlStatement.
300PerformIndexableProductsSqlQueryGets an IEnumerable using the SQL query from result.FormattedSqlStatement and assigns it to result.IndexableProducts.

### MapElasticSearchProductProperty

OrderPipeDescription
100MapElasticSearchProductCustomPropertiesIf the parameter.SearchBoost.IsQueryable is true and parameter.PropertyDefinition.IsCustomProperty is true sets result.Property to a new Nest TextProperty.

## ProductSearchPipeline

### FormProductFilter

<table class="TableStyle-Borders" style="margin-left: 0; margin-right: auto; width: 100%;" data-cellspacing="0"> <colgroup> <col style="width: 33%" /> <col style="width: 33%" /> <col style="width: 33%" /> </colgroup> <thead> <tr class="header TableStyle-Borders-Head-Header1"> <th class="TableStyle-Borders-HeadE-Regular-Header1">Order</th> <th class="TableStyle-Borders-HeadE-Regular-Header1">Pipe</th> <th class="TableStyle-Borders-HeadD-Regular-Header1">Description</th> </tr> </thead> <tbody> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1"><p>100</p></td> <td class="TableStyle-Borders-BodyE-Regular-Row1">GetSettings</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">Retrieves SearchGeneralSettings and ProductRestrictionsSettings and assigns them to the result object.</td> </tr> <tr class="even TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">200</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">FormWebsiteFilter</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">Adds a new MatchQuery using the result.SiteContext.WebsiteDto.Id on the websiteId field to result.AllFilters and assigns it to result.WebsiteFilter.</td> </tr> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">300</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">FormLanguageFilter</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">Adds a new MatchQuery using the result.SiteContext.LanguageDto.LanguageCode on the languageCode field to result.AllFilters and assigns it to result.LanguageFilter.</td> </tr> <tr class="even TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">400</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">FormCategoryFilter</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">Creates a new PrefixQuery to search a single category or the whole category tree based on parameter.ProductSearchParameter fields (SearchCriteria and IncludeSubcategories) then adds it to result.AllFilters and assigns it to result.CategoryFilter.</td> </tr> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">500</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">FormRestrictionGroupFilter</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">If Restriction Groups are enabled, uses the ProductSearchPipeline's FormRestrictionGroupFilter pipe to generate a new filter then adds the filter to result.AllFilters and assigns it to result.RestrictionGroupFilter.</td> </tr> <tr class="even TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">600</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">FormAttributeValueFilter</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">Creates PrefixQueries for attributes based on parameter.ProductSearchParameter.AttributeValueIds and combines them into a BooleanQuery. That BooleanQuery is added to result.AllFilters and assigned to result.AttributeValueFilter.</td> </tr> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">700</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">FormAllowedProductsFilter</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">Creates MatchQuery objects for each product in parameter.ProductSearchParameter.AllowedProductIds and combines them into a BooleanQuery. That BooleanQuery is add to result.AllFilters and assigned to result.AllowedProductsFilter.</td> </tr> <tr class="even TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">800</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">FormPriceRangeFilter</td> <td class="TableStyle-Borders-BodyD-Regular-Row1"><p>If parameter.ProductSearchParameter.PriceFilters has any values a new MatchQuery is created for each filter and combined into a BooleanQuery (OR) then assigned to result.PriceRangeFilter and added to result.AllFilters.</p> <p>If parameter.ProductSearchParameter.PriceFilters has no values and parameter.ProductSearchParameter.MinimumPrice or parameter.ProductSearchParameter.MaximumPrice have been supplied a new Range query is created using the supplied min/max values with defaults of 0 and 1000000 if either was omitted. That Range query is then added to result.AllFilters and assigned to result.PriceRangeFilter.</p> <p>If no filters were supplied and neither the minimumPrice or maximumPrice were supplied nothing is done and the pipe returns.</p></td> </tr> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyB-Regular-Row1">900</td> <td class="TableStyle-Borders-BodyB-Regular-Row1">CombineFilters</td> <td class="TableStyle-Borders-BodyA-Regular-Row1">Creates a BoolQuery (AND) of all filters in result.AllFilters and assigns it to result.CombinedFilter.</td> </tr> </tbody> </table>

### FormRestrictionGroupFilter

<table class="TableStyle-Borders" style="margin-left: 0; margin-right: auto; width: 100%;" data-cellspacing="0"> <colgroup> <col style="width: 33%" /> <col style="width: 33%" /> <col style="width: 33%" /> </colgroup> <thead> <tr class="header TableStyle-Borders-Head-Header1"> <th class="TableStyle-Borders-HeadE-Regular-Header1">Order</th> <th class="TableStyle-Borders-HeadE-Regular-Header1">Pipe</th> <th class="TableStyle-Borders-HeadD-Regular-Header1">Description</th> </tr> </thead> <tbody> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">100</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">GetRestrictionGroupFilterFromCache</td> <td class="TableStyle-Borders-BodyD-Regular-Row1"><p>Attempts to retrieve the restriction group filter from cache based on the current BillTo/ShipTo and assigns it to result.RestrictionGroupFilter.</p> <p>If there was a cached filter the pipeline exits.</p> <p>if there was no cached filter the pipeline continues to the next pipe.</p></td> </tr> <tr class="even TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">200</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">GetDefaultVisibilityFilters</td> <td class="TableStyle-Borders-BodyD-Regular-Row1"><p>Creates a new MatchQuery on the restrictionGroups field to match products with no restriction groups and adds it to result.DefaultVisibilityFilters.</p> <p>Creates a Terms query on the defaultVisibility field with values of empty and show then adds it to result.DefaultVisibilityFilters.</p></td> </tr> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">300</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">GetWebsiteRestrictionGroupQuery</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">Creates an EF query to get the active restriction groups based on the current website and assigns it to result.WebsiteRestrictionGroupQuery.</td> </tr> <tr class="even TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">400</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">GetWebsiteRestrictionGroups</td> <td class="TableStyle-Borders-BodyD-Regular-Row1"><p>Uses result.WebsiteRestrictionGroupQuery to get active restriction groups then assigns them to result.WebsiteRestrictionGroups.</p> <p>If there are any active restriction groups a BoolQuery (AND) is created from result.DefaultVisibilityFilters and assigned to result.RestrictionGroupFilter then the pipeline exits.</p> <p>If there are no active restriction groups the pipeline continues to the next pipe.</p></td> </tr> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">500</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">GetCustomerRestrictionGroupIds</td> <td class="TableStyle-Borders-BodyD-Regular-Row1"><p>If there is no BillTo the pipeline does nothing and continues to the next pipe.</p> <p>If BillTo or ShipTo are populated result.CustomerRestrictionGroupIds is set to the applicable restriction group IDs from result.WebsiteRestrictionGroupQuery.</p></td> </tr> <tr class="even TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">600</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">GetShowOnlyRestrictionGroupIds</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">Adds all restriction group IDs from result.WebsiteRestrictionGroups where the restrictiongroup type is "ShowOnly" and is an applicable restriction group (result.CustomerRestrictionGroupIds) to result.ShowOnlyRestrictionGroupIds.</td> </tr> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">700</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">GetShowRestrictionGroupIds</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">Adds all restriction group IDs from result.WebsiteRestrictionGroups where the restrictiongroup type is "Show" and is an applicable restriction group (result.CustomerRestrictionGroupIds) to result.ShowRestrictionGroupIds.</td> </tr> <tr class="even TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">800</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">GetHideRestrictionGroupIds</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">Adds all restriction group IDs from result.WebsiteRestrictionGroups where the restrictiongroup type is "Hide" and is an applicable restriction group (result.CustomerRestrictionGroupIds) to result.HideRestrictionGroupIds.</td> </tr> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">900</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">FormShowOnlySubFilter</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">Creates a Terms query on the field restrictionGroups with the values from result.ShowOnlyRestrictionGroupIds then adds it to result.SubFilters and assigns it to result.ShowOnlySubFilter.</td> </tr> <tr class="even TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">1000</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">FormShowSubFilter</td> <td class="TableStyle-Borders-BodyD-Regular-Row1"><p>If there are no filters in result.DefaultVisibilityFilters and no filters in result.ShowRestrictionGroupIds continue to next pipe.</p> <p>Creates BoolQuery (AND) from the filters in result.DefaultVisibilityFilters.Creates MatchQuery objects on the field restrictionGroups for all restriction groups in result.ShowRestrictionGroupIds.</p> <p>Combines the previously created queries into a BoolQuery (OR) then adds it to result.SubFilters and assigns it to result.ShowSubFilter.</p></td> </tr> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">1100</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">FormHideSubFilter</td> <td class="TableStyle-Borders-BodyD-Regular-Row1"><p>If there are no filters in result.HideRestrictionGroupIds continue to next pipe.</p> <p>Creates MatchQuery (NOT) object on the field restrictionGroups for all restrcition groups in result.HideRestrictionGroupIds.</p> <p>Combines the previously created queries into a BoolQuery (AND) then adds it to result.SubFilters and assigns it to result.HideSubFilter.</p></td> </tr> <tr class="even TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">1200</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">CombineFilters</td> <td class="TableStyle-Borders-BodyD-Regular-Row1"><p>If result.ShowOnlySubFilter is empty and result.SubFilters is empty continue to next pipe.</p> <p>Create a BoolQuery (AND) fromt he filters in result.SubFilters.</p> <p>Combine BoolQuery just created and result.ShowOnlySubFilter into a new BoolQuery (OR) and assign it to result.RestrictionGroupFilter.</p></td> </tr> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyB-Regular-Row1">1300</td> <td class="TableStyle-Borders-BodyB-Regular-Row1">AddRestrictionGroupFilterToCache</td> <td class="TableStyle-Borders-BodyA-Regular-Row1">Adds result.RestrictionGroupFilter to the cache based on the current BillTo/ShipTo.</td> </tr> </tbody> </table>

### RunProductSearch

<table class="TableStyle-Borders" style="margin-left: 0; margin-right: auto; width: 100%;" data-cellspacing="0"> <colgroup> <col style="width: 33%" /> <col style="width: 33%" /> <col style="width: 33%" /> </colgroup> <thead> <tr class="header TableStyle-Borders-Head-Header1"> <th class="TableStyle-Borders-HeadE-Regular-Header1">Order</th> <th class="TableStyle-Borders-HeadE-Regular-Header1">Pipe</th> <th class="TableStyle-Borders-HeadD-Regular-Header1">Description</th> </tr> </thead> <tbody> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">100</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">GetSettings</td> <td class="TableStyle-Borders-BodyD-Regular-Row1"><p>Retrieves SearchGeneralSettings, CatalogGeneralSettings, FuzzySearchSettings, SponsoredSearchSettings and SearchSuggestionsSettings then assign them to the result object.</p> <p>Set result.UsingListPrice, result.CanSortPrice, and result.PriceFacetingEnabled from various settings objects.</p></td> </tr> <tr class="even TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">200</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">InitializeSearchProperties</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">Retrieve and assign values for result.BoostHelper, result.ElasticsearchIndex, result.ElasticsearchQueryBuilder, result.PhraseSuggestConfiguration, and result.ProductSearchFacetProcessor.</td> </tr> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">300</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">FormSortOrder</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">Populate result.SortOrderFields based on parameter.ProductSearchParameter fields.</td> </tr> <tr class="even TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">400</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">ApplySortOrder</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">Create a new Nest SortDescriptor&lt;ElasticsearchProduct&gt; and set the sort based on result.SortOrderFields.</td> </tr> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">500</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">GetQueryFields</td> <td class="TableStyle-Borders-BodyD-Regular-Row1"><p>Adds the fields that are queryable using data from the search.SearchBoosts table to result.ExactMatchFields, result.PrefixMatchFields, and result.PhraseMatchFields.</p> <p>Adds the fields that are part of fuzzy match (categoryNames and shortDescription) to result.FuzzyMatchFields.</p></td> </tr> <tr class="even TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">600</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">FormSearchCriteriaQuery</td> <td class="TableStyle-Borders-BodyD-Regular-Row1"><p>If parameter.ProductSearchParameter.SearchCriteria is blank continue on to next pipe without doing anything else.</p> <p>Creates and assigns queries for result.ExactMatchQuery, result.PrefixMatchQuery, result.PhraseMatchQuery and result.FuzzyMatchQuery (if enabled) based on the fields assigned in GetQueryFields pipe.</p> <p>All new queries added to result.AllQueries.</p></td> </tr> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">700</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">FormCustomerNameQuery</td> <td class="TableStyle-Borders-BodyD-Regular-Row1"><ul> <li>If parameter.ProductSearchParameter.SearchCriteria is blank for BillTo and ShipTo are null continue on to next pipe without doing anything else.</li> <li>If BillTo is not null create a PrefixQuery on the customerNames field and match on BillTo.Id + searchCriteria.</li> <li>If ShipTo is not null create a PrefixQuery on the customerNames field and match on ShipTo.Id + searchCriteria.</li> <li>Create a BoolQuery (OR) from the previously created queries then add it to result.AllQueries and assign it to result.CustomerNameQuery.</li> </ul></td> </tr> <tr class="even TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">800</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">FormSearchWithinQuery</td> <td class="TableStyle-Borders-BodyD-Regular-Row1"><p>If parameter.ProductSearchParameter.SearchWithin is blank continue on to the next pipe without doing anything else.</p> <p>Create a MultiMatchQuery of type CrossFields for Product on the result.ExactMatch fields querying on parameter.ProductSearchParameter.SearchWithin and assign it to result.SearchWithinQuery.</p></td> </tr> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">900</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">CombineQueries</td> <td class="TableStyle-Borders-BodyD-Regular-Row1"><p>Create a BoolQuery (OR) from result.AllQueries.</p> <p>If result.SearchWithinQuery is not null create a BoolQuery (AND) with it and the previously created BoolQuery.</p> <p>Assign the resulting BoolQuery to result.CombinedQuery (either just the first BoolQuery or the combined BoolQuery).</p></td> </tr> <tr class="even TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">1000</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">FormProductFilter</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">Use the ProductSearchPipeline's FormProductFilter pipeline to get the product filter and assign it to result.FormProductFilterResult.</td> </tr> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">1100</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">FormCategoryAggregation</td> <td class="TableStyle-Borders-BodyD-Regular-Row1"><ul> <li>If parameter.ProductSearchParameter.DoFacetedSearches is false continue on to the next pipe without doing anything else.</li> <li>If parameter.ProductSearchParameter.SearchCriteria is blank and parameter.ProductSearchParameter.IncludeSubcategories is false continue on to the next pipe without doing anything else.</li> <li>Using result.FormProductFilterResult.AllFilters create a BoolQuery (AND). With that query create FilterAggregationDescriptor func for the categories field and add it to result.AllAggregations and assign it to result.CategoryAggregation.</li> </ul></td> </tr> <tr class="even TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">1200</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">FormAttributeValueAggregation</td> <td class="TableStyle-Borders-BodyD-Regular-Row1"><p>If parameter.ProductSearchParameter.DoFacetedSearches is false or result.SearchGeneralSettings.EnableAttributeFilters is false continue on to the next pipe without doing anything else.</p> <p>If result.SearchGeneralSettings.FilterOnSearch if false and parameter.ProductSearchParameter.SearchCriteria is not blank continue on to the next pipe without doing anything else.</p> <p>Using result.FormProductFilterResult.AllFilters create a BoolQuery (AND). With that query create FilterAggregationDescriptor func for the filters field and add it to result.AllAggregations and assign it to result.AttributeValueAggregation.</p> <p>If parameter.ProductSearchParameter.GetAllAttributeFacets is false continue on to the next pipe without doing anything else.</p> <p>Using result.FormProductFilterResult.AllFilters where the filters are not equal to result.FormProductFilterResult.AttribueValueFilter create a BoolQuery (AND). With that query create FilterAggregationDescriptor func for the filters field and add it to result.AllAggregations and assign it to result.AllAttributeValueAggregation.</p></td> </tr> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">1300</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">FormPriceRangeAggregation</td> <td class="TableStyle-Borders-BodyD-Regular-Row1"><p>If parameter.ProductSearchParameter.DoFacetedSearches is false or result.PriceFacetingEnabled is false continue on to the next pipe without doing anything else.</p> <p>Using result.FormProductFilterResult.AllFilters where the filters are not equal to result.FormProductFilterResult.PriceRangeFilter create a BoolQuery (AND). With that query create FilterAggregationDescriptor func for the priceFacet field and add it to result.AllAggregations and assign it to result.PriceRangeAggregation.</p></td> </tr> <tr class="even TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">1350</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">FormPersonaScoreFunctionList</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">If parameter.SiteContext.PersonaDtos contains personas with EnableSearchBoost true, the result ScoreFunctions collection will be populated with one WeightFunction for each persona with a TermQuery on the Persona.Id and boost value as a Weight. The ScoreFunctions collection will be added to the query by the ApplyQueryAndFilter pipe.</td> </tr> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">1400</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">CombineAggregations</td> <td class="TableStyle-Borders-BodyD-Regular-Row1"><p>If parameter.ProductSearchParameter.DoFacetedSearches is false continue on to the next pipe without doing anything else.</p> <p>Call result.CombinedAggregation.Filter for each aggregation in result.AllAggregations and assign the result to result.CombinedAggregation.</p></td> </tr> <tr class="even TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">1500</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">FormDidYouMeanSuggestion</td> <td class="TableStyle-Borders-BodyD-Regular-Row1"><p>If result.PhraseSuggestConfiguration.Enabled is false or productSearchParameter.IncludeSuggestions is false or productSearchParameter.SearchCriteria is blank continue on to the next pipe without doing anything else.</p> <p>Call result.PhraseSuggestConfiguration.Configure with productSearchParameter.SearchCriteria and result.SearchSuggestions.DidYouMeanThreshold (limited to 0 to 5) and assign the value to result.DidYouMeanSuggestion and add it to result.AllSuggestions.</p></td> </tr> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">1600</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">FormAutoCorrectSuggestion</td> <td class="TableStyle-Borders-BodyD-Regular-Row1"><p>If result.PhraseSuggestConfiguration.Enabled is false or productSearchParameter.IncludeSuggestions is false or productSearchParameter.SearchCriteria is blank continue on to the next pipe without doing anything else.</p> <p>Call result.PhraseSuggestConfiguration.Configure with productSearchParameter.SearchCriteria and result.SearchSuggestions.AutoCorrectThreshold (limited to 0 to 5) and assign the value to result.DidYouMeanSuggestion and add it to result.AllSuggestions.</p></td> </tr> <tr class="even TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">1700</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">CombineSuggestions</td> <td class="TableStyle-Borders-BodyD-Regular-Row1"><p>If result.PhraseSuggestConfiguration.Enabled is false or productSearchParameter.IncludeSuggestions is false or productSearchParameter.SearchCriteria is blank continue on to the next pipe without doing anything else.</p> <p>Call result.CombinedSuggestion.Phrase for each suggestion in result.AllSuggestions and assign the result to result.CombinedSuggestion.</p></td> </tr> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">1800</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">ApplySuggestion</td> <td class="TableStyle-Borders-BodyD-Regular-Row1"><p>If result.PhraseSuggestConfiguration.Enabled is false or productSearchParameter.IncludeSuggestions is false or productSearchParameter.SearchCriteria is blank continue on to the next pipe without doing anything else.</p> <p>Call result.SearchDescriptor.Suggest with result.CombinedSuggestion and assign the result to result.SearchDescriptor.</p></td> </tr> <tr class="even TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">1900</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">PerformAggregationSearch</td> <td class="TableStyle-Borders-BodyD-Regular-Row1"><p>If parameter.ProductSearchParameter.DoFacetedSearches is false or result.AllAggregations is empty continue on to the next pipe without doing anything else.</p> <p>Create an AggregationSearchDescriptor from result.CombinedQuery and result.FormProductFilterResult.CombinedFilter then use that to query Elasticsearch. Assign result from Elasticsearch to result.AggregationSearchResponse.</p></td> </tr> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">2000</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">ProcessCategoryAggregation</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">Use result.ProductSearchFacetProcessor.ProcessCategoryFacets to process the facets and assign the return value to result.ProductSearchResult.CategoryDtos.</td> </tr> <tr class="even TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">2100</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">ProcessAttributeValueAggregation</td> <td class="TableStyle-Borders-BodyD-Regular-Row1"> Use ProductSearchFacetProcessor.ProcessAttributeTypeFacets to process the facets and assign the return value to result.ProductSearchResult.AttributeTypeDtos.</td> </tr> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">2200</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">ProcessPriceRangeAggregation</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">Use ProductSearchFacetProcessor.ProcessPriceRangeFacets to process the facets and assign the return value to result.ProductSearchResult.PriceRangeDto.</td> </tr> <tr class="even TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">2300</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">PerformSponsoredSearch</td> <td class="TableStyle-Borders-BodyD-Regular-Row1"><p>If result.SponsoredSearchSettings.Enabled is false or parameter.IsAutocomplete is true or this is a filtered search or if this is not sorted by relevance or parameter.ProductSearchParameter.SearchCriteria is blank continue on to the next pipe without doing anything else.</p> Create a new TermQuery on the isSponsored field. That is added to a new query along with result.CombinedQuery and result.FormProductFilterResult.CombinedFilter with a max result lenght of result.SponsoredSearchSettings.Limit or 5. This is used to query Elasticsearch. The results are assigned to result.SponsoredSearchResponse.</td> </tr> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">2400</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">ProcessSponsoredSearchResponse</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">If result.SponsoredSearchResponse is null continue on to the next pipe without doing anything else. <p>Create a new QueryContainerDescriptor&lt;ElasticsearchProduct&gt; to exclude all sponsored result Ids and assign it to result.ExcludeSponsoredProductsFilter.</p> <p>Set result.ProductSearchResult.Count to the sponsored search's total results.</p> <p>If this is the first page of results (result.StartRow equals 0), add the returned products to result.ProductSearchResult.Products and set result.PageSize to result.PageSize minus the number of sponsored results returned.</p> If this is not the first page of results (result.StartRow does not equal 0), set result.StartRow to result.StartRow minus the number of sponsored results returned.</td> </tr> <tr class="even TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">2500</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">ApplyQueryAndFilter</td> <td class="TableStyle-Borders-BodyD-Regular-Row1"><p>If result.ExcludeSponsoredProductsFilter is not null make a new new boolean query with result.FormProductFilterResult.CombinedFilter and result.ExcludeSponsoredProductsFilter.</p> <p>If result.CombinedQuery is null create a SearchDescriptor using only the above created filter or result.FormProductFilterResult.CombinedFilter.</p> <p>If result.CombinedQuery is not null and result.SearchGeneralSettings.EnableProductBoost is true, create a SearchDescriptor with a FunctionScore query using result.CombinedQuery and the above created filter or result.FormProductFilterResult.CombinedFilter with a FieldValueFactor function using the boost field and assign it to result.SearchDescriptor.</p> <p>If result.ScoreFunctions collection is not null or empty, these functions will be added to the FunctionScore query. This will provide boosting of products with certain personas.</p> If result.CombinedQuery is not null and result.SearchGeneralSettings.EnableProductBoost is false, createa  SearchDescriptor using result.CombinedQuery and the above created filter or result.FormProductFilterResult.CombinedFilter. </td> </tr> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">2600</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">ApplyPaging</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">Set from and size on result.SearchDescriptor using result.StartRow and result.PageSize.</td> </tr> <tr class="even TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">2700</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">PerformSearch</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">Set from and size on result.SearchDescriptor using result.StartRow and result.PageSize.</td> </tr> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">2800</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">ProcessSearchResponse</td> <td class="TableStyle-Borders-BodyD-Regular-Row1"><p>If result.SearchResponse is null or is not valid return a SearchFailure code with relevant message.</p> <p>Add returned products from SearchResponse to result.ProductSearchResult.Products.</p> <p>Add the total count of returned products to result.ProductSearchResult.Count.</p> <p>If result.CanSortByPrice is false or result.UsingListPrice is false and result.ProductSearchResult.Count is greater than result.CatalogGeneralSettings.PriceSortMaximum, then set result.CanSortByPrice to false, set result.ProductSearchResult.SortOrder to result.SortBy and set result.ProductSearchResult.SortOptions to parameter.SortOptions where PriceLowToHigh and PriceHighToLow are removed.</p> If result.CanSortByPrice is true or result.UsingListPrice is true and result.ProductSearchResult.Count is less than or equal to result.CatalogGeneralSettings.PriceSortMaximum, then set result.ProductSearchResult.SortOptions to parameter.SortOptions.</td> </tr> <tr class="even TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyE-Regular-Row1">2900</td> <td class="TableStyle-Borders-BodyE-Regular-Row1">ProcessDidYouMeanSuggestion</td> <td class="TableStyle-Borders-BodyD-Regular-Row1">If result.SearchResponse.Suggest is null or result.SearchResponse.Suggest does not contain the key "didyoumean" or didYouMeanSuggestions.Length is not equal to 1 continue on to the next pipe without doing anything else.<br /> Populate result.ProductSearchResult.DidYouMeanSuggestions from the result.SearchResponse.Suggest entry for "didyoumean".</td> </tr> <tr class="odd TableStyle-Borders-Body-Row1"> <td class="TableStyle-Borders-BodyB-Regular-Row1">3000</td> <td class="TableStyle-Borders-BodyB-Regular-Row1">ProcessAutoCorrectSuggestion</td> <td class="TableStyle-Borders-BodyA-Regular-Row1"><p>If result.SearchResponse.Suggest is null or result.SearchResponse.Suggest does not contain the key "correction" or autoCorrectSuggestions.Length is not equal to 1 continue on to the next pipe without doing anything else.</p> Populate result.ProductSearchResult.AutoCorrectSuggestion from the result.SearchResponse.Suggest entry for "correction".</td> </tr> </tbody> </table>