Dev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideLegal TermsGitHubDev CommunityOptimizely AcademySubmit a ticketLog In
Dev Guide

Third-party search pipeline

📘

Note

This pipeline information is applicable to Elasticsearch version 7.10 (Nest7) and any third-party search provider extending third-party search abstractions and Shared Search pipelines. For an overview of third-party search functionality, see Implement a third-party search provider. For pipeline information specific to default Elasticsearch version 5.5 (Nest5) implementations in Configured Commerce, see Search pipelines.

CategorySearchPipeline - Shared

RunCategorySearch - Shared

OrderPipeDescription
100InitializeSearchPropertiesMaps parameters for SearchClient, SearchQueryBuilder, and SearchCategoryMapper into result.
200GetSettingsUses Dependency Injection to get instances of SearchGeneralSettings and FuzzySearchSettings, attaching to the result to be used during pipeline processing.
300GetQueryFieldsUses Dependency Injection to get an instance of the IBoostHelper get searchBoosts for Category, attaching to the result to be used during pipeline processing.
400FormPagingTakes the parameter's StartRow and PageSize attaching to the result to be used during pipeline processing.
500FormCategoryExcludeListAttaches the DisallowedCategories List generated from the ProductSearchProvider.
The DisallowedCategories List will be cached for 15 minutes. Cache Key is based on ("CategorySearchDisallowedCategories" + + <SiteContent.ShipTo.Id>)
600FormCategoryExcludeFilterUsing result.DisallowedCategories List to filter out categories generated during FormCategoryExcludeList pipe processing.
700FormLanguageFilterUsing result.SiteContext.LanguageDto to filter Search Results to a specific LanguageCode.
If not processed, will include results from all Languages.
800FormWebsiteFilterUses result.SiteContext.WebsiteDto to filter Search Results to a specific Website.
If result.SiteContext.WebsiteDto is null, will cause Pipeline Exception/Error.
900FormTypeFilterUses Parameter.AddTypeFilter will add a Query Filter for 'type' equaling 'category'.
1000CombineFiltersCombines result.AllFilters into a single SearchQuery with an Operation of 'And' setting Query to result.CombinedFilter.
If no filters are found, will set result.CombinedFilter to null.
1100FormMainSearchQueryCreates a SearchQuery from result.CategorySearchFields against the parameter.Criteria query value for a MultiMatchQuery and MultiMatchPrefixQuery search type.
1200FormFuzzySearchQueryCreates a SearchQuery from result.CategorySearchFields against the parameter.Criteria query value for a MultiMatchFuzzyQuery search type.
1300CombineQueriesCombines result.AllQueries into a single SearchQuery with an Operation of 'Or' setting Query to result.CombinedQuery.
1400ApplyQueryAndFilterCreates a FunctionScoreQuery attaching as a new SearchDescriptor.
The Score Function is for the Boost Field with a FunctionBoostMode.Multiply boost function.
Creates a single BooleanQuery from result.CombinedQuery and result.CombinedFilter using the Operation of 'And' for the FunctionScoreQuery.
1500ApplyPagingSets From and Size on result.SearchDescriptor.
1600ApplySortOrderCreates SortDescriptor using the ISearchCategoryObject.SortOrder and SortOrderField.Score as fields that will be set as SortOrder.Descending.
Sets on Sort of result.SearchDescriptor.
1700PerformSearchPerforms result.SearchResult.Search(...) passing in parameter.IndexType and result.SearchDescriptor as arguments, saving result to result.SearchResponse.
1800ProcessSearchResponseValidates for null and IsValid details of result.searchResponse.
Returns an Error PipelineResult when the results are not valid.

ContentSearchPipeline - Shared

RunContentSearch - Shared

OrderPipeDescription
100InitializeSearchPropertiesUses Dependency Injection to get instance of SearchGeneralSettings attaching to result.SearchGeneralSettings to be used during pipeline processing.
200ValidatePageSizeValidates parameter.PageSize is between 0 and 1000, setting result.PageSize. If less than 10 will set value to 10,;if greater than 1000 sets value to 1000.
300FormQueryMakes a MultiMatchQuery with ISearchContentObject.Title, ISearchContentObject.Body, ISearchContentObject.MetaDescription and ISearchContentObject.MetaKeywords fields to boost against the parameter.Query with the arguments SearchAnalyzerTypes.QueryAnalyzer, SearchOperator.Or and SearchTextQueryType.CrossFields. Makes a MultiMatchQuery with ISearchContentObject.Title, ISearchContentObject.Body, ISearchContentObject.MetaDescription and ISearchContentObject.MetaKeywords fields to boost against the parameter.Query with the arguments SearchAnalyzerTypes.LowercaseAnalyzer, SearchOperator.Or, SearchTextQueryType.PhrasePrefix, a 'slop' of 100, a 'boostName' of SearchBoost.QueryType.Prefix. Makes a BooleanQuery of prior MultiMatchQuery with the Operation.Or assigns to variable 'combined'. Makes a FieldQuery with ISearchContentObject.ContentKey based on if perRequestCacheManager has a value for "SpireContent" assigns to variable 'cmsTypeFilter'. Makes a BooleanQuery from variables 'combined' and 'cmsTypeFilter' using the Operation.And assigns to result.Query.
400FormFilterMakes multiple TermQuery one for each listed field: ISearchContentObject.WebsiteId, ISearchContentObject.LanguageId, ISearchContentObject.DeviceType and ISearchContentObject.PersonaId using values from the SiteContext.Current. Makes a TermQuery for the field ISearchContentObject.ContentKey with the values from IContentPageFilterService.GetRestrictedPages. Makes a single BooleanQuery from the above TermQuery objects using the Operation.And assigns to result.Filter.
500PerformSearchIf parameter.ProductSearchParameter.DoFacetedSearches is false or result.AllAggregations is empty, continues to the next pipe.
Creates a new SearchDescriptor ISearchContentObject assigns to variable 'searchDescriptor'. Makes a BooleanQuery from result.Query and result.Filter with an Operation.And setting searchDescriptor.WithQuery. Sets result.PageSize using searchDescriptor.WithSize. Creates AggregationContainer with Term of 'contentAggregation' (PerformSearch.ContentAggregationKey), that includes a Term of ISearchContentObject.Url and Size of result.PageSize. Pior AggreationContainer includes a nested AggreationContainer with Term of 'contentAggregation_top_hits' (PerformSearch.TopHitsAggregationKey), that includes a TopHits name of 'contentAggregation_top_hits' (PerformSearch.TopHitsAggregationKey) and Size of 1. (This is done to create a known structure for how the URLs aggregation should be retrived in, this works well with Elasticsearch but might need finessing to work with other providers.) result.CombinedQuery is null create an SearchDescriptor ISearchProductObject.WithPostFilter from result.FormProductFilterResult.CombinedFilter. Assigns result from parameter.SearchClient.Search to result.SearchResponse.
600ProcessSearchResponseIf result.SearchResponse.Aggregations does not contain PerformSearch.ContentAggregationKey, continues to the next pipe. Selects from the the PerformSearch.ContentAggregationKey Items any PerformSearch.TopHitsAggregationKey using the parameter.SearchContentMapper.ToContentSearchResultDto to create new ContentSearchResultDto assigns the resulting collection to result.ContentSearchResults.
700ProcessSearchResponseForAllAggregationsIf result.SearchResponse.Aggregations does not contain PerformSearch.ContentAggregationKey, continues to the next pipe. Selects from result.SearchResponse.Aggregations all PerformSearch.TopHitsAggregationKey using the parameter.SearchContentMapper.ToContentSearchResultDto to create new ContentSearchResultDto assigns the resulting collection to result.ContentSearchResults.
800ProcessSearchResponseFromResultIf result.ContentSearchResults is empty continue to the next pipe. Selects from result.SearchResponse.Hits all not null and using the parameter.SearchContentMapper.ToContentSearchResultDto to create new ContentSearchResultDto assigns the resulting collection to result.ContentSearchResults.

IndexBuilderPipeline - Shared

ConfigureIndexSettings - Shared

OrderPipeDescription
100GetIndexFieldsLooping through the parameter.FieldTypeList will create and add the properties as ModelField instances to result.CreateIndexDescriptor.FieldModelList.
200GetIndexCategoryCustomPropertyFieldsUsing the IEntityDefinitionProvider to get the Category Definition and add all IsCustomProperty flagged Properties to result.CreateIndexDescriptor.FieldModelList.
300GetIndexProductCustomPropertyFieldsUsing IBoostHelper.GetSearchBoosts to get Product SearchBoost Records and add all starting with Field_attributes. to result.CreateIndexDescriptor.FieldModelList.
400GetIndexProductAttributePropertyFieldsUsing the IEntityDefinitionProvider to get the Product Definition and add all IsCustomProperty flagged Properties to result.CreateIndexDescriptor.FieldModelList.

ProductSearchPipeline - Shared

FormProductFilter - Shared

OrderPipeDescription
100GetSettingsUses Dependency Injection to get SearchGeneralSettings and ProductRestrictionsSettings; then assigns them to the result object.
200FormWebsiteFilterSets variable 'websiteId' with parameter.ProductSearchParameter.WebSiteId or parameter.SiteContext.WebsiteDto.Id.
If variable 'websiteId' is null, continues to next pipe. Create FieldQue using the variable of 'websiteId' on the ISearchProductObject.Websites field and assign it to result.WebsiteFilter.
Adds result.WebsiteFilter to result.AllFilters.
300FormLanguageFilterIf parameter.SiteContext.LanguageDto is null, continues to next pipe.
Makes a FieldQuery using the parameter.SiteContext.LanguageDto.LanguageCode on the ISearchProductObject.LanguageCode field and assign it to result.LanguageFilter.
Add result.LanguageFilter to result.AllFilters.
400FormCategoryFilterIf parameter.ProductSearchParameter.CategoryId is null continue to next pipe. Makes a PrefixQuery to search against ISearchProductObject.Categories or ISearchProductObject.Categories based on parameter.ProductSearchParameter.SearchCriteria and parameter.ProductSearchParameter.IncludeSubcategories and assigns it to result.CategoryFilter. Add result.CategoryFilter to result.AllFilters.
500FormBrandFilterIf parameter.ProductSearchParameter.BrandIds is null or empty continue to next pipe. When parameter.ProductSearchParameter.BrandIds has only 1 brandId, make a FieldQuery for the ISearchProductObject.BrandId field against the single 'brandId' assigns it to result.BrandFilter. When parameter.ProductSearchParameter.BrandIds is greater than 1, make a collection of FieldQuery queries from the parameter.ProductSearchParameter.BrandIds collection assigns a BooleanQuery with the Operation.Or of the FieldQuery collection. Add result.BrandFilter to result.AllFilters.
600FormProductLineFilterIf parameter.ProductSearchParameter.ProductLineIds is null or empty continue to next pipe. When parameter.ProductSearchParameter.ProductLineIds has only 1 'productLineId', make a FieldQuery for the ISearchProductObject.ProductLineId field against the single 'productLineId' assigns it to result.ProductLineFilter. When parameter.ProductSearchParameter.ProductLineIds is greater than 1, make a collection of FieldQuery queries from the parameter.ProductSearchParameter.ProductLineIds collection for the ISearchProductObject.ProductLineId field assigns a BooleanQuery with the Operation.Or of the FieldQuery collection. Add result.ProductLineFilter to result.AllFilters.
700FormRestrictionGroupFilterIf parameter.FormRestrictionGroupFilter is false or result.ProductRestrictionsSettings.RestrictionsByItem is false, continue to next pipe. Uses the IProductSearchPipeline.FormRestrictionGroupFilter pipe to generate a new filter and if IProductSearchPipeline.FormRestrictionGroupFilter does not return a ResultCode.Success will PipelineHelper.CopyResult and continue to next pipe. If result.SearchGeneralSettings.NestedDocumentsInteractionEnabled is false then the newly generated filter is assigned to result.RestrictionGroupFilter. If result.SearchGeneralSettings.NestedDocumentsInteractionEnabled is true, IProductSearchPipeline.FormChildProductsRestrictionGroupFilter is used to generated the child products restriction group filter and if IProductSearchPipeline.FormRestrictionGroupFilter does not return a ResultCode.Success will PipelineHelper.CopyResult and continue to next pipe. The child products restriction group filter is assigned to result.ChildProductsRestrictionGroupFilter and the further the child restriction group filter is combined with Nested Query to check if ISearchProductObject.ChildProducts field path exists and form nested query on child restriction group filter. The nested child products restriction groups filter and parent restrictions group filter are combined using BooleanQuery with Operation.And and assigned to result.RestrictionGroupFilter. Add result.RestrictionGroupFilter to result.AllFilters if result.RestrictionGroupFilter is not null.
800FormAttributeValueFilterIf parameter.ProductSearchParameter.AttributeValueIds is null or empty continue to next pipe. Make a PrefixQuery for each parameter.ProductSearchParameter.AttributeValueIds against the ISearchProductObject.Filters field and combines them into a BooleanQuery with the Operation.Or. Makes a BooleanQuery with the Operation.And for each 'attributeTypeQueries' assigns to result.AttributeValueFilter. Adds result.AttributeValueFilter to result.AllFilters.
900FormAllowedProductsFilterIf parameter.ProductSearchParameter.AllowedProductIds is null or empty continue to next pipe. Makes FieldQuery for each product in parameter.ProductSearchParameter.AllowedProductIds against the ISearchProductObject.ProductId field and combines them into a BooleanQuery using the Operation.Or assigns to result.AllowedProductsFilter. Adds result.AllowedProductsFilter to result.AllFilters.
1000FormPriceRangeFilterIf parameter.ProductSearchParameter.PriceFilters is null or empty and parameter.ProductSearchParameter.MinimumPrice or parameter.ProductSearchParameter.MaximumPrice is null continue to next pipe.
If parameter.ProductSearchParameter.PriceFilters has any values make a FieldQuery for each filter in parameter.ProductSearchParameter.PriceFilters and combined into a BooleanQuery with the Operation.Or assigns to result.PriceRangeFilter.
If parameter.ProductSearchParameter.PriceFilters has no values and makes a NumericRangeQuery for the ISearchProductObject.Price field using using parameter.ProductSearchParameter.MinimumPrice and parameter.ProductSearchParameter.MaximumPrice with defaults of 0 and 1000000 if either are omitted assigns to result.PriceRangeFilter. Adds result.PriceRangeFilter to result.AllFilters.
1100FormProductIdFilterIf parameter.ProductSearchParameter.ProductIds is null or empty continue to next pipe. Makes FieldQuery for each product in parameter.ProductSearchParameter.ProductIds against the ISearchProductObject.ProductId field and combines them into a BooleanQuery using the Operation.Or assigns to result.ProductIdFilter. Adds result.ProductIdFilter to result.AllFilters.
1200FormProductNameFilterIf parameter.ProductSearchParameter.ProductNames is null or empty continue to next pipe. Makes FieldQuery for each product in parameter.ProductSearchParameter.ProductNames against the ISearchProductObject.Name field and combines them into a BooleanQuery using the Operation.Or assigns to result.ProductNameFilter. Adds result.ProductNameFilter to result.AllFilters.
1300FormProductErpNumberFilterIf parameter.ProductSearchParameter.ProductErpNumbers is null or empty continue to next pipe. Makes FieldQuery for each product in parameter.ProductSearchParameter.ProductErpNumbers against the ISearchProductObject.ErpNumberSort field and combines them into a BooleanQuery using the Operation.Or assigns to result.ProductErpNumberFilter. Adds result.ProductErpNumberFilter to result.AllFilters.
1400CombineFiltersMakes a BoolQuery with the Operation.And of all filters in result.AllFilters and assigns it to result.CombinedFilter or null if filters are empty.

FormRestrictionGroupFilter - Shared

OrderPipeDescription
100GetRestrictionGroupFilterFromCacheAttempts to retrieve the restriction group filter from the IPerRequestCacheManager cache based on the current parameter.SiteContext.BillTo.Id and parameter.SiteContext.ShipTo.Id and assigns it to result.RestrictionGroupFilter. (SearchProvider_RestrictionGroupFilter_<BillTo.Id>_<ShipTo.Id>) If the result.RestrictionGroupFilter is set the pipeline exits. If there was no result.RestrictionGroupFilter the pipeline continues to the next pipe.
200GetDefaultVisibilityFiltersMakes a MatchQuery on the ISearchProductObject.RestrictionGroups field to match products with no restriction groups and adds it to result.DefaultVisibilityFilters. Makes a FieldMultivalueQuery on the ISearchProductObject.DefaultVisibility field with of show then adds it to result.DefaultVisibilityFilters.
300GetWebsiteRestrictionGroupQueryCreates an EntityFramework query calling GetActiveRestrictionGroupsAsNoTracking with the parameter.SiteContext.WebsiteDto.Id (the current website) and assigns it to result.WebsiteRestrictionGroupQuery.
400GetWebsiteRestrictionGroupsUses result.WebsiteRestrictionGroupQuery to get active restriction groups then assigns them to result.WebsiteRestrictionGroups.
If result.WebsiteRestrictionGroups is not empty continue on to the next pipe.
If result.WebsiteRestrictionGroups is empty create a BooleanQuery with an Operation.And is created from result.DefaultVisibilityFilters and assigned to result.RestrictionGroupFilter. Sets result.ExitPipeline to true exiting the Pipeline.
500GetCustomerRestrictionGroupIdsIf parameter.SiteContext.BillTo is null continues to the next pipe. If parameter.SiteContext.BillTo and parameter.SiteContext.ShipTo are populated set result.CustomerRestrictionGroupIds to the restriction group Ids from result.WebsiteRestrictionGroupQuery. If parameter.SiteContext.BillTo is not null and parameter.SiteContext.ShipTo is null set result.CustomerRestrictionGroupIds to the restriction group Ids for just the parameter.SiteContext.BillTo.Id from result.WebsiteRestrictionGroupQuery.
600GetShowOnlyRestrictionGroupIdsIf result.CustomerRestrictionGroupIds is empty continue to next pipe. Adds all restriction group Ids from result.WebsiteRestrictionGroups where the restrictiongroup type is "ShowOnly" (RestrictionGroup.RestrictionGroupDisplayType.ShowOnly) and is an applicable restriction group (result.CustomerRestrictionGroupIds) to result.ShowOnlyRestrictionGroupIds.
700GetShowRestrictionGroupIdsIf result.CustomerRestrictionGroupIds is empty continue to next pipe. Adds all restriction group Ids from result.WebsiteRestrictionGroups where the restrictiongroup type is "Show" (RestrictionGroup.RestrictionGroupDisplayType.Show) and is an applicable restriction group (result.CustomerRestrictionGroupIds) to result.ShowRestrictionGroupIds.
800GetHideRestrictionGroupIdsIf result.CustomerRestrictionGroupIds is empty continue to next pipe. Adds all restriction group Ids from result.WebsiteRestrictionGroups where the restrictiongroup type is "Hide" (RestrictionGroup.RestrictionGroupDisplayType.Hide) and is an applicable restriction group (result.CustomerRestrictionGroupIds) to result.HideRestrictionGroupIds.
900FormShowOnlySubFilterIf result.CustomerRestrictionGroupIds is empty continue to next pipe. Creates a FieldMultivalueQuery on the ISearchProductObject.RestrictionGroups field with the values from result.ShowOnlyRestrictionGroupIds then adds it to result.SubFilters and assigns it to result.ShowOnlySubFilter.
1000FormShowSubFilterIf result.DefaultVisibilityFilters is empty and result.ShowRestrictionGroupIds is empty continue to next pipe. Creates BooleanQuery with Operation.And from the filters in result.DefaultVisibilityFilters. Creates FieldQuery objects on the field ISearchProductObject.RestrictionGroups for all restriction groups in result.ShowRestrictionGroupIds. Combines the previously created queries into a BooleanQuery with the Operation.Or then assigns it to result.ShowSubFilter. Adds result.ShowSubFilter to result.SubFilters.
1100FormHideSubFilterIf result.HideRestrictionGroupIds is empty continue to next pipe. Creates FieldQuery as Not on the field ISearchProductObject.RestrictionGroups for all restrcition groups in result.HideRestrictionGroupIds. Combines the previously created queries into a BooleanQuery with the Operation.And and assigns it to result.HideSubFilter. Add result.HideSubFilter to result.SubFilters.
1200CombineFiltersIf result.ShowOnlySubFilter is empty and result.SubFilters is empty continue to next pipe. Create a BooleanQuery with the Operator.And from the filters in result.SubFilters. Combine result.ShowOnlySubFilter and the prior result.SubFilters BooleanQuery into a new BooleanQuery with the Operation.Or and assign it to result.RestrictionGroupFilter.
1300AddRestrictionGroupFilterToCacheIf result.RestrictionGroupFilter is null continue to next pipe. Adds result.RestrictionGroupFilter to the cache based on the result from GetRestrictionGroupFilterFromCache.GetRestrictionGroupFilterCacheKey.

FormChildProductsRestrictionGroupFilter - Shared

OrderPipeDescription
100GetRestrictionGroupFilterFromCacheAttempts to retrieve the restriction group filter from the IPerRequestCacheManager cache based on the current parameter.SiteContext.BillTo.Id and parameter.SiteContext.ShipTo.Id and assigns it to result.RestrictionGroupFilter. (SearchProvider_RestrictionGroupFilter_ChildProducts_<BillTo.Id>_<ShipTo.Id>) If the result.RestrictionGroupFilter is set the pipeline exits. If there was no result.RestrictionGroupFilter the pipeline continues to the next pipe.
200GetDefaultVisibilityFiltersMakes a MatchQuery on the ISearchProductObject.RestrictionGroups field to match child products with no restriction groups and adds it to result.DefaultVisibilityFilters. Makes a FieldMultivalueQuery on the ISearchProductObject.DefaultVisibility field with of show then adds it to result.DefaultVisibilityFilters. If parameter.WebsiteRestrictionGroups does not have any, result.DefaultVisibilityFilter is assisgned to result.RestrictionGroupFilter and exit the pipeline.
300FormShowOnlySubFilterIf result.CustomerRestrictionGroupIds is empty continue to next pipe. Creates a FieldMultivalueQuery on the ISearchProductObject.ChildProducts.RestrictionGroups field with the values from result.ShowOnlyRestrictionGroupIds then adds it to result.SubFilters and assigns it to result.ShowOnlySubFilter.
400FormShowSubFilterIf result.DefaultVisibilityFilters is empty and result.ShowRestrictionGroupIds is empty continue to next pipe. Creates BooleanQuery with Operation.And from the filters in result.DefaultVisibilityFilters. Creates FieldQuery objects on the field ISearchProductObject.ChildProducts.RestrictionGroups for all restriction groups in result.ShowRestrictionGroupIds. Combines the previously created queries into a BooleanQuery with the Operation.Or then assigns it to result.ShowSubFilter. Adds result.ShowSubFilter to result.SubFilters.
500FormHideSubFilterIf result.HideRestrictionGroupIds is empty continue to next pipe. Creates FieldQuery as Not on the field ISearchProductObject.ChildProducts.RestrictionGroups for all restrcition groups in result.HideRestrictionGroupIds. Combines the previously created queries into a BooleanQuery with the Operation.And and assigns it to result.HideSubFilter. Add result.HideSubFilter to result.SubFilters.
600CombineFiltersIf result.ShowOnlySubFilter is empty and result.SubFilters is empty continue to next pipe. Create a BooleanQuery with the Operator.And from the filters in result.SubFilters. Combine result.ShowOnlySubFilter and the prior result.SubFilters BooleanQuery into a new BooleanQuery with the Operation.Or and assign it to result.RestrictionGroupFilter.
700AddRestrictionGroupFilterToCacheIf result.RestrictionGroupFilter is null continue to next pipe. Adds result.RestrictionGroupFilter to the cache based on the result from GetRestrictionGroupFilterFromCache.GetRestrictionGroupFilterCacheKey.

RunBrandSearch - Shared

OrderPipeDescription
100InitializeSearchPropertiesUses Dependency Injection to attach IBoostHelper, and SearchGeneralSettings, then assign them to the result object. Set IndexType, SearchClient, and SearchQueryBuilder from the parameter to the result.
200FormProductFilterUse the ProductSearchPipeline's FormProductFilter pipeline to get the product filter and assign it to result.FormProductFilterResult.
400GetQueryFieldsUsing result.BoostHelper to get a list of IsQueryable fields for Brand Entity. If no queryableFields are not found set result.ExitPipeline to true and continue pipeline. Will set 'queryableFields' to result.ExactMatchFields, result.ExactMatchFields and result.ExactMatchFields.
500FormQueryCreates a MultimatchQuery, MultimatchPrefixQuery and MultiMatchFuzzyQuery for the typeof(Brand) Entity, using parameter.Criteria against the result.ExactMatchFields, result.PrefixMatchFields or result.FuzzyMatchFields fields matching to the query type.
600CombineQueriesCreate a BooleanQuery with an Operation.Or for all non-null result.AllQueries attaching to result.CombinedQuery.
700FormBrandAggregationIf parameter.ProductLinesEnabled is true fill 'aggregationField' to nameof(ISearchProductObject.BrandProductLineFacet). If parameter.ProductLinesEnabled is false fill 'aggregationField' to nameof(ISearchProductObject.BrandFacet). With that query create FilterAggregationDescriptor function for the Term of 'brandName' (FormBrandAggregation.BrandAggregationKey) term against the 'aggregationField', with SearchTermOrder Key of 'brandName_max_score' (FormBrandAggregation.MaxScoreAggregationKey) with an Order of SortOrder.Descending, and with Aggregations with Max of 'brandName_max_score' (FormBrandAggregation.MaxScoreAggregationKey) using a Script of '_score' and TopHits of 'brandName_top_hits' (FormBrandAggregation.TopHitsAggregationKey) using a Descending '_score' Sort and Size of 1. Set result.BrandAggregationContainer with result.BrandAggregationContainer.WithFilter taking 'brandName' (FormBrandAggregation.BrandAggregationKey) and result.BrandAggregation as arguments.
800CombineFiltersIf result.AllFilters is not null and greater than 0 add result.AllFilters making a BooleanQuery of result.AllFilters with the Operation.And. If result.AllFilters is null set result.CombinedFilter a value null.
900ApplyQueryAndFilterMake a BooleanQuery using the Operator.And with result.CombinedQuery and result.CombinedFilter setting 'combinedQueryAndFilter'. Use 'combinedQueryAndFilter' from before and make use result.SearchQueryBuilder.MakeFunctionScoreQuery with a FunctionBoostMode.Multiply function using the 'Boost' field and assign it to result.SearchDescriptor.
1000PerformSearchMake a BooleanQuery using the Operator.And with result.CombinedQuery and result.FormProductFilterResult.CombinedFilter setting 'combinedQueryAndFilter'. Create variable 'aggregationSearchDescriptor' setting to SearchDescriptor().WithQuery using 'combinedQueryAndFilter' and with Aggregations of result.BrandAggregationContainer and a Size of 0. Call result.SearchClient.Search with the result.IndexType and 'aggregationSearchDescriptor' arguments setting result to result.AggregationSearchResponse.
1100ProcessBrandAggregationIf result.AggregationSearchResponse.Aggregations is null or empty set result.ExitPipeline to true and continue pipeline. Lookup result.AggregationSearchResponse.Aggregations.AggregateToHitsTuples for FormBrandAggregation.BrandAggregationKey setting result to vairable 'brandHitsTuples'. Fallback lookup to result.AggregationSearchResponse.Aggregations.AggregateToHitsTuples for ISearchProductObject.BrandFacet when FormBrandAggregation.BrandAggregationKey is not found, setting result to vairable 'brandHitsTuples'. If both ISearchProductObject.BrandFacet when FormBrandAggregation.BrandAggregationKey are not found in result.AggregationSearchResponse.Aggregations continue on with the pipeline. Using 'brandHitsTuples' create new SearchTopHitsAggregate with 'Items' assgined from result.AggregationSearchResponse.Hits equal to hit.Source.BrandFacet assign result to result.TopHitsAggregates.
1200ProcessTopHitsAggregatesIf result.TopHitsAggregates is null set result.BrandSearchResult.Brands to empty List and result.ExitPipeline to true then continue on to next pipe. Sets result.BrandSearchResult.Brands by transforming result.TopHitsAggregates in a collection of BrandSearchResultDto. Sets result.BrandSearchResult.Count to result.TopHitsAggregates.Count().
1300SortAndLimitBrandsIf result.BrandSearchResult.Brands is null continue on to next pipe. If parameter.MaximumNumber is greater than or equal to result.BrandSearchResult.Brands Count order result.BrandSearchResult.Brands using OrderByDescending by 'Score' taking parameter.MaximumNumber. If parameter.ProductLinesEnabled is true and has any result.BrandSearchResult.Brands that do not have a blank 'ProductLineName', order result.BrandSearchResult.Brands using OrderByDescending by 'Score'. If the prior checks do pass fall back to Soring by Score for the parameter.MaximumNumber. Setting brand results to result.BrandSearchResult.Brands.
1400ProcessProductLinesIf parameter.Criteria is null, result.BrandSearchResult?.Brands is null or result.BrandSearchResult.Brands all ProductLineNames are empty continue on to next pipe. Creates a variable 'queryWords' by spliting parameter.Criteria by ' ' (Space). Null the ProductLineId, ProductLineName and ProductLIneUrlSegement fields on result.BrandSearchResult.Brands for the brandResult's that do not match any queryWords to 'ProdctLineName'. Also null the fields if parameter.ProductLinesEnabled is not true. Using result.BrandSearchResult.Brands group by 'Id' and 'ProductLineId', select the first Group and taking parameter.MaximumNumber then assign to result.BrandSearchResult.Brands. This removes duplicates.

RunProductFacetSearch - Shared

OrderPipeDescription
100InitializeSearchPropertiesUses Dependency Injection to attach ProductSearchFacetProcessor, and SearchGeneralSettings, then assign them to the result object. Set IndexType, SearchClient, and SearchQueryBuilder from the parameter to the result.
200FormProductFilterUse the ProductSearchPipeline's FormProductFilter pipeline to get the product filter and assign it to result.FormProductFilterResult.
300FormQueryIf parameter.ProductFacetSearchParameter.BrandStartsWith is blank continue on to next pipe. Make a MultimatchPrefixQuery for parameter.ProductFacetSearchParameter.BrandStartsWith against the ISearchProductObject.BrandNameFirstCharacter field.
400FormBrandFiltersSets result.AllFilters list based on what is set in the parameter object. Filters are added for any non-null parameter.ProductFacetSearchParameter.BrandId, parameter.ProductFacetSearchParameter.ProductLineId, parameter.ProductFacetSearchParameter.GetFeaturedProductLine, parameter.ProductFacetSearchParameter.Manufacturer, or parameter.ProductFacetSearchParameter.GetSmallBrandImage. Based on parameter.ProductFacetSearchParameter.GetFeaturedProductLine or parameter.ProductFacetSearchParameter.GetSponsoredProductLine flags filters are individually set for the fields ISearchProductObject.ProductLineIsFeatured and ISearchProductObject.ProductLineIsSponsored.
500CombineFiltersIf result.AllFilters is not null and greater than 0 add result.FormProductFilterResult.CombinedFilter to result.AllFilters making a BooleanQuery of result.AllFilters with the Operation.And. If result.AllFilters is null set result.CombinedFilter to the value of result.FormProductFilterResult.CombinedFilter.
600GetFacetFieldBased on the ProductFacetSearchType value of parameter.ProductFacetSearchParameter.SearchType set result.FacetField to either: ISearchProductObject.BrandFacet, ISearchProductObject.BrandNameFirstCharacter, ISearchProductObject.ProductLineFacet, or ISearchProductObject.Categories. Will throw an ErrorPipelineResult if not a valid type.
700FormAggregationSet result.AggregationKey to result.FacetField.ToCamelCase, creating FilterAggregationDescriptor with filter result.CombinedFilter and aggregation using Term result.AggregationKey against field result.FacetField.ToCamelCase. Aggregations are ordered by the SearchTermsOrder key of '_term' ordered by parameter.ProductFacetSearchParameter.SortAscending. Set result.AggregationContainer to result.AggregationContainer.WithFilter using result.AggregationKey and result.Aggregation as arguments. When result.Query is not null sets result.AggregationSearchDescriptor to a SearchDescriptor with a Query with the Operation.And of result.Query and result.CombinedFilter. When result.Query is null sets result.AggregationSearchDescriptor to a SearchDescriptor with a Query of result.CombinedFilter. Set result.AggregationContainer with result.AggregationSearchDescriptor.WithAggregations and WithSize of 0.
800PerformSearchUse result.SearchClient.Search to call a ISearchClient using result.IndexType and result.AggregationSearchDescriptor and assign the result to result.SearchResponse.
900ProcessAggregationLookup result.SearchResponse.Aggregations.AggregateToHitsTuples for result.AggregationKey setting the response to result.AggregationHits. If result.SearchResponse.Aggregations.AggregateToHitsTuples return null set to empty List<Tuple<string, long>>.
1000ProcessCategoryHitsIf parameter.ProductFacetSearchParameter.SearchType is not ProductFacetSearchType.Category continue on to the next pipe. Use result.ProductSearchFacetProcessor.ProcessCategoryFacets to process the facets from result.AggregationHits and assign the return value to result.ProductFacetSearchResult.
1100ProcessBrandFirstCharacterHitsIf parameter.ProductFacetSearchParameter.SearchType is not ProductFacetSearchType.BrandFirstCharacter continue on to the next pipe. Use result.ProductSearchFacetProcessor.ProcessStringFacets to process the facets from result.AggregationHits and assign the return value to result.ProductFacetSearchResult.
1200ProcessGenericHitsIf parameter.ProductFacetSearchParameter.SearchType is not ProductFacetSearchType.Brand or ProductFacetSearchType.ProductLine continue on to the next pipe. Use result.ProductSearchFacetProcessor.ProcessGenericFacets to process the facets from result.AggregationHits and assign the return value to result.ProductFacetSearchResult.

RunProductSearch - Shared

OrderPipeDescription
100GetSettingsUses Dependency Injection to attach CatalogGeneralSettings, FuzzySearchSettings, SearchGeneralSettings, SearchSuggestionsSettings, SponsoredSearchSettings and BoostingSettings then assign them to the result object. Set result.UsingListPrice, result.CanSortPrice, and result.PriceFacetingEnabled from various settings objects.
200InitializeSearchPropertiesUses Dependency Injection to attach BoostHelper, PhraseSuggestConfiguration and ProductSearchFacetProcessor then assign them to the result object. Assigns parameters instances of IndexType, EnableNgram, EnableProductNumberTiebreaker, SearchClient, SearchQueryBuilder and SearchProductMapper to result object.
300FormSortOrderPopulate result.SortOrderFields based on parameter.ProductSearchParameter fields.
400ApplySortOrderCreates a new SortDescriptor and set the sort based on result.SortOrderFields to the result.SearchDescriptor.
500GetQueryFieldsAdds the fields that are queryable using data from the search.SearchBoosts table to result.ExactMatchFields, result.PrefixMatchFields, and result.PhraseMatchFields. Adds the fields that are part of fuzzy match (ISearchProductObject.CategoryNames and ISearchProductObject.ShortDescription) to result.FuzzyMatchFields.
600FormSearchCriteriaQueryIf parameter.ProductSearchParameter.SearchCriteria is blank continue on to next pipe. Creates and assigns queries for result.ExactMatchQuery, result.PrefixMatchQuery, result.PhraseMatchQuery and result.FuzzyMatchQuery (if result.FuzzySearchSettings.Enabled is true) based on the fields assigned in GetQueryFields pipe. All new queries added to result.AllQueries.
700FormCustomerNameQueryIf parameter.ProductSearchParameter.SearchCriteria is blank for parameter.SiteContext.BillTo and parameter.SiteContext.ShipTo are null continue on to next pipe. If parameter.SiteContext.BillTo is not null create a PrefixQuery, MatchAllQuery and not true PrefixQuery on the customerNames field and match on parameter.SiteContext.BillTo.Id + parameter.ProductSearchParameter.SearchCriteria. If parameter.SiteContext.ShipTo is not null create a PrefixQuery, MatchAllQuery and not true PrefixQuery on the customerNames field and match on parameter.SiteContext.ShipTo.Id + parameter.ProductSearchParameter.SearchCriteria. Create a BoolQuery with the Operation.Or from the previously created queries then add it to result.AllQueries and assign it to result.CustomerNameQuery.
800FormUrlSegmentQueryUse the ProductSearchPipeline's FormProductFilter pipeline to get the product filter and assign it to result.FormProductFilterResult.
900FormSearchWithinQueryIf parameter.ProductSearchParameter.SearchWithin is blank continue on to the next pipe. Create   MultiMatchQuery using result.SearchQueryBuilder.MakeMultimatchQuery of result.ExactMatchFields fields querying on parameter.ProductSearchParameter.SearchWithin and assign it to result.SearchWithinQuery. Does not add Query to result.AllQueries, it is an additional query to the normal query.
1000FormPreviouslyPurchasedProductQueryIf parameter.ProductSearchParameter.EnableBoostingByPurchaseHistory, result.BoostingSettings.AllowFilteringForPreviouslyPurchasedProducts or parameter.ProductSearchParameter.PreviouslyPurchasedProducts are false or parameter.SiteContext.BillTo is null will continue on to the next pipe. Makes a BooleanQuery using request.SearchQueryBuilder to create a SearchQuery of ISearchProductObject.CustomersFrequentlyPurchased and ISearchProductObject.CustomersLessFrequentlyPurchased fields against the query criteria of parameter.SiteContext.BillTo.Id.
1100FormStockedItemsOnlyQueryIf either the Dependency Injection ProductListSettings.DisplayFacetsForStockedItems or parameter.ProductSearchParameter.StockedItemsOnly values are false will continue on to the next pipe. Makes a BooleanQuery using request.SearchQueryBuilder to create Stocked Check Queries at the Product and Warehouse levels. Creates Boolean Query against the ISearchProductObject.IsStocked field for true and ISearchProductObject.IsStockedAtWarehouseLevel field for false. Creates Boolean Query against the ISearchProductObject.IsStockedAtWarehouseLevel field for true and ISearchProductObject.StockedWarehouses field for parameter.SiteContext.WarehouseDto.Id or parameter.SiteContext.PickUpWarehouseDto.Id based on parameter.SiteContext.FulfillmentMethod. Creates a BooleanQuery with the two Product and Warehouse IsStocked queries using the Operation.Or and assign it to result.StockedItemsOnlyQuery
1200CombineQueriesCreate a BooleanQuery using the Operator.Or from result.AllQueries that are not null. If the list of the previously created BooleanQuery, result.SearchWithinQuery, result.PreviouslyPurchasedProductQuery, result.StockedItemsOnlyQuery or result.ProductUrlSegmentQuery does not contain a null value it create a BooleanQuery with an Operator.And and assign it to result.CombinedQuery. If all of the Queries stated eariler are null then null will be assigned to result.CombinedQuery.
1300FormProductFilterUse the ProductSearchPipeline's FormProductFilter pipeline to get the product filter and assign it to result.FormProductFilterResult.
1400FormCategoryAggregationIf parameter.ProductSearchParameter.DoFacetedSearches is false continue on to the next pipe. If parameter.ProductSearchParameter.SearchCriteria is blank and parameter.ProductSearchParameter.BrandIds is null or parameter.ProductSearchParameter.BrandIds.Count is 0 and parameter.ProductSearchParameter.IncludeSubcategories is false continue on to the next. If parameter.ProductSearchParameter.IncludeSubcategories is true then use result.FormProductFilterResult.AllFilters to create a BooleanQuery with the Operation.And. If parameter.ProductSearchParameter.IncludeSubcategories is false then use result.FormProductFilterResult.AllFilters that do not match the result.FormProductFilterResult.CategoryFilter to create a BooleanQuery with the Operation.And. Creates a FilterAggregationDescriptor function for the ISearchProductObject.Categories field and add it to result.AllAggregations with the 'categories' key and assign it to result.CategoryAggregation.
1500FormBrandAggregationIf either the Dependency Injection CatalogGeneralSettings.EnableBrands or parameter.ProductSearchParameter.DoFacetedSearches is false continue on to the next pipe. Using result.FormProductFilterResult.AllFilters create a BooleanQuery with an Operator.And. With that query create FilterAggregationDescriptor function for the 'brands' field and add it to result.AllAggregations and assign it to result.BrandAggregation.
1600FormProductLineAggregationIf either the Dependency Injection CatalogGeneralSettings.EnableBrands or parameter.ProductSearchParameter.DoFacetedSearches is false continue on to the next pipe. Using result.FormProductFilterResult.AllFilters create a BooleanQuery with an Operation.And. With that query create FilterAggregationDescriptor function for the 'productLineFacet' field and add it to result.AllAggregations and assign it to result.ProductLineAggregation.
1700FormAttributeValueAggregationIf parameter.ProductSearchParameter.DoFacetedSearches is false or result.SearchGeneralSettings.EnableAttributeFilters is false continue on to the next pipe. If result.SearchGeneralSettings.FilterOnSearch if false and parameter.ProductSearchParameter.SearchCriteria is not blank continue on to the next pipe. Using result.FormProductFilterResult.AllFilters create a BooleanQuery using the Operator.And. With that query create FilterAggregationDescriptor function for the 'websiteFilters' field if result.SearchGeneralSettings.WebsiteSpecificAttributes is true or the 'filters' field when not true. Adds it to result.AllAggregations and assign it to result.AttributeValueAggregation. If parameter.ProductSearchParameter.GetAllAttributeFacets is false continue on to the next pipe. Using result.FormProductFilterResult.AllFilters where the filters are not equal to result.FormProductFilterResult.AttribueValueFilter create a BooleanQuery with the Operator.And. With that query create FilterAggregationDescriptor function for the field used by result.AttributeValueAggregation and add it to result.AllAggregations and assign it to result.AllAttributeValueAggregation.
1800FormPriceRangeAggregationIf parameter.ProductSearchParameter.DoFacetedSearches is false or result.PriceFacetingEnabled is false continue on to the next pipe. Using result.FormProductFilterResult.AllFilters where the filters are not equal to result.FormProductFilterResult.PriceRangeFilter create a BooleanQuery with the Operator.And. With that query create FilterAggregationDescriptor function for the 'priceFacet' field and add it to result.AllAggregations and assign it to result.PriceRangeAggregation.
1900FormPersonaScoreFunctionListIf parameter.SiteContext.PersonaDtos contains personas with EnableSearchBoost true, the result.ScoreFunction will be populated with one WeightFunction for each persona with a TermQuery on the 'Persona.Id' and 'BoostValue' as a 'Weight'. The result.ScoreFunctions collection will be added to the query by the ApplyQueryAndFilter pipe.
2000FormFrequentlyPurchasedFunctionListIf result.BoostingSettings.EnableBoostingByPurchaseHistory, result.BoostingSettings.AllowFilteringForPreviouslyPurchasedProducts or parameter.ProductSearchParameter.PreviouslyPurchasedProducts are false or parameter.SiteContext.BillTo is null will continue on to the next pipe. Makes a BooleanQuery using request.SearchQueryBuilder to create a SearchQuery of ISearchProductObject.CustomersFrequentlyPurchased and ISearchProductObject.CustomersLessFrequentlyPurchased fields against the query criteria of parameter.SiteContext.BillTo.Id, setting query on result.PreviouslyPurchasedProductQuery.
2100CombineAggregationsIf parameter.ProductSearchParameter.DoFacetedSearches is false continue on to the next pipe. Using result.CombinedAggregation.WithFilter for each aggregation in result.AllAggregations and assign the result to result.CombinedAggregation.
2200FormDidYouMeanSuggestionIf result.PhraseSuggestConfiguration.Enabled, result.SearchSuggestionsSettings.DidYouMeanEnabled or productSearchParameter.IncludeSuggestions are false or parameter.ProductSearchParameter.SearchCriteria is blank continue on to the next pipe. Call result.PhraseSuggestConfiguration.Configure with parameter.ProductSearchParameter.SearchCriteria and result.SearchSuggestions.DidYouMeanThreshold (limited to 0 to 5) and assign the value  o result.DidYouMeanSuggestion and add it to result.AllSuggestions.
2300FormAutoCorrectSuggestionIf result.PhraseSuggestConfiguration.Enabled, result.SearchSuggestionsSettings.AutoCorrectEnabled or parameter.ProductSearchParameter.IncludeSuggestions is false or parameter.ProductSearchParameter.SearchCriteria is blank continue on to the next pipe.
Call result.PhraseSuggestConfiguration.Configure with parameter.ProductSearchParameter.SearchCriteria and result.SearchSuggestions.AutoCorrectThreshold (limited to 0 to 5) and assign the value to result.DidYouMeanSuggestion and add it to result.AllSuggestions.
2400FormScoreExplanationIf parameter.ProductSearchParameter.GetScoreExplanation is true calls result.SearchDescriptor.EnableExplain.
2500CombineSuggestionsIf result.PhraseSuggestConfiguration.Enabled or parameter.ProductSearchParameter.IncludeSuggestions is false or parameter.ProductSearchParameter.SearchCriteria is blank continue on to the next pipe.
Call result.CombinedSuggestion.Phrase for each suggestion in result.AllSuggestions and assign the result to result.CombinedSuggestion.
2600ApplySuggestionIf result.PhraseSuggestConfiguration.Enabled or parameter.ProductSearchParameter.IncludeSuggestions is false or parameter.ProductSearchParameter.SearchCriteria is blank continue on to the next pipe.
Call result.SearchDescriptor.WithSuggest with result.CombinedSuggestion and assign the result to result.SearchDescriptor.
2700PerformAggregationSearchIf parameter.ProductSearchParameter.DoFacetedSearches is false or result.AllAggregations is empty continue on to the next pipe. When result.CombinedQuery is not null create an SearchDescriptor.WithQuery from result.CombinedQuery and result.FormProductFilterResult.CombinedFilter. When result.CombinedQuery is null create an SearchDescriptor.WithPostFilter from result.FormProductFilterResult.CombinedFilter. Assign result from result.SearchClient.Search to result.AggregationSearchResponse.
2800ProcessCategoryAggregationIf result.AggregationSearchResponse.Aggregations.AggregateToHitsTuples for FormCategoryAggregation.CategoryAggregationKey or ISearchProductObject.Categories is not found continue on to the next pipe. Use result.ProductSearchFacetProcessor.ProcessCategoryFacets to process the facets and assign the return value to result.ProductSearchResult.CategoryDtos.
2900ProcessBrandAggregationIf result.AggregationSearchResponse.Aggregations.AggregateToHitsTuples for FormBrandAggregation.BrandAggregationKey or ISearchProductObject.BrandFacet is not found continue on to the next pipe. Use result.ProductSearchFacetProcessor.ProcessGenericFacets to process the facets and assign the return value to result.ProductSearchResult.BrandDtos.
3000ProcessProductLineAggregationIf result.AggregationSearchResponse.Aggregations.AggregateToHitsTuples for FormProductLineAggregation.ProductLineAggregationKey is not found continue on to the next pipe.
Use result.ProductSearchFacetProcessor.ProcessGenericFacets process the facets and assign the return value to result.ProductSearchResult.ProductLineDtos.
3100ProcessAttributeValueAggregationUse result.ProductSearchFacetProcessor.ProcessAttributeTypeFacets to process the facets from FormAttributeValueAggregation.AttributeValueAggregationKey and FormAttributeValueAggregation.AllAttributeValueAggregationKey and assign the return value to result.ProductSearchResult.AttributeTypeDtos.
3200ProcessPriceRangeAggregationIf result.AggregationSearchResponse.Aggregations.AggregateToHitsTuples for FormPriceRangeAggregation.PriceRangeAggregationKey is not found continue on to the next pipe. Uses result.ProductSearchFacetProcessor.ProcessPriceRangeFacets to process the facets and assigns the return value to result.ProductSearchResult.PriceRangeDto.
3300PerformSponsoredSearchIf 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. Using result.SearchQueryBuilder.MakeTermQuery on the ISearchProductObject.IsSponsored field. When result.CatalogGeneralSettings.EnableBrands is true creates a ISearchDescriptor for the 'sponsoredSearchDescriptor' using ISearchProductObject.ProductLineIsSponsored and ISearchProductObject.BrandIsSponsored TermQueries with result.CombinedQuery and result.FormProductFilterResult.CombinedFilter BooleanQuery with the Operator.And. When result.CatalogGeneralSettings.EnableBrands is false creates a ISearchDescriptor for the 'sponsoredSearchDescriptor' using result.CombinedQuery and result.FormProductFilterResult.CombinedFilter. The ISearchDescriptor for the 'sponsoredSearchDescriptor' has max result length of result.SponsoredSearchSettings.Limit or 5. Uses result.SearchClient.Search to query against the 'sponsoredSearchDescriptor'. The results are assigned to result.SponsoredSearchResponse.
3400ProcessSponsoredSearchResponseIf result.SponsoredSearchResponse is null continue on to the next pipe. Create a new SearchQuery to exclude all result.SponsoredSearchResponse.Documents Ids and assign it to result.ExcludeSponsoredProductsFilter. Set result.SponsoredSearchResultsCount to the result.SponsoredSearchResponse.Hits.Count.
3500ApplyQueryAndFilterIf result.ExcludeSponsoredProductsFilter is not null make a new BooleanQuery using the Operator.And with result.FormProductFilterResult.CombinedFilter and result.ExcludeSponsoredProductsFilter setting 'combinedFilter'. If result.CombinedQuery is null set result.SearchDescriptor.WithQuery using the 'combinedFilter' from before and assign it to result.SearchDescriptor. If result.CombinedQuery is not null set result.SearchDescriptor.WithQuery using result.CombinedQuery and the 'combinedFilter' from before and assign it to result.SearchDescriptor. If result.CombinedQuery is not null and result.SearchGeneralSettings.EnableProductBoost is true, set result.SearchDescriptor.WithQuery with a FunctionScore query using result.CombinedQuery and the 'combinedFilter' from before using result.SearchQueryBuilder.MakeFunctionScoreQuery with a FunctionBoostMode.Multiply function using the 'boost' field and assign it to result.SearchDescriptor. If result.ScoreFunctions collection is not null or empty, these functions will be added to the FunctionScoreQuery. This will provide boosting of products with certain personas.
3600ApplyPagingIf result.IsSortingByPrice is false or result.UsingListPrice is true then set result.SearchDescriptor.WithPage, result.SearchDescriptor.WithFrom, and result.SearchDescriptor.WithSize on result.SearchDescriptor using result.Page, result.StartRow and result.PageSize. Else, set result.SearchDescriptor.WithPage, result.SearchDescriptor.WithFrom, and result.SearchDescriptor.WithSize result.CatalogGeneralSettings.PriceSortMaximum on result.SearchDescriptor as 1, 0 and result.CatalogGeneralSettings.PriceSortMaximum.
3700PerformSearchUse result.SearchClient.Search to call a ISearchClient using result.IndexType and result.SearchDescriptor and assign the result to result.SearchResponse.
3800ProcessSearchResponseIf result.SearchResponse is null or is result.SearchResponse.IsValid is false return a SearchFailure code with a relevant message. Add products mapped using result.SearchProductMapper.ToProductSearchResultDto from result.SearchResponse.Hits to result.ProductSearchResult.Products. Add the total count of returned products and count of Sponsored Search results to result.ProductSearchResult.Count. 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 SortOrderType.PriceLowToHigh and SortOrderType.PriceHighToLow are removed. 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. If the result.CatalogGeneralSettings.EnableBrands setting is false or parameter.ProductSearchParameter.BrandIds equals 1, remove BrandAToZ and BrandZToA sorting from result.ProductSearchResult.SortOptions.
3850ProcessSearchResponsePaginationIf result.SearchResponse is null or is result.SearchResponse.IsValid is false return a SearchFailure code with a relevant message. Set result.ProductSearchResult.Page, result.ProductSearchResult.PageSize, result.ProductSearchResult.NoOfPages and result.ProductSearchResult.DefaultPageSize using result.Page, result.PageSize, result.SearchResponse.Total, result.DefaultPageSize.
3900ProcessStyledProductSearchResponseFor each result.SaerchResponse.Hits where ISearchHit.Source.StyledChiledren is not null and cound is greater than 1 lookup product fields for each product. Fills ProductSearchResultDto properties of: StyledProductERPNumber, ShortDescription, MediumImagePath, SmallImagePath, ManufacturerItemNumber, and StyledProductId.
4000ProcessExplanationIf parameter.ProductSearchParameter.GetScoreExplanation is false or result.ProductSearchResult.Products is null continue on to the next pipe. Populate each Product.ScoreExplanation with ISearchHit.Explanation scoring data. The logic for filling the Explanation data is based on Elasticsearch, checkout the logic in the ProcessExplanation source if supported is wanted.
4100ProcessDidYouMeanSuggestionIf result.SearchResponse.Suggest is null or result.SearchResponse.Suggest does not contain the key "didyoumean" (FormDidYouMeanSuggestion.PhraseSuggestDidYouMeanKey) or didYouMeanSuggestions.Length is not equal to 1 continue on to the next pipe. Populate result.ProductSearchResult.DidYouMeanSuggestions from the result.SearchResponse.Suggest entry for "didyoumean" (FormDidYouMeanSuggestion.PhraseSuggestDidYouMeanKey) and where 'Suggestion' is not equal to parameter.ProductSearchParameter.SearchCriteria.
4200ProcessAutoCorrectSuggestionIf result.SearchResponse.Suggest is null or result.SearchResponse.Suggest does not contain the key "correction" (FormAutoCorrectSuggestion.PhraseSuggestAutoCorrectionKey) or autoCorrectSuggestions.Length is not equal to 1 or SearchCriteria matches Product ERP Number continue on to the next pipe. Populate result.ProductSearchResult.AutoCorrectSuggestion from the result.SearchResponse.Suggest entry for "correction" (FormAutoCorrectSuggestion.PhraseSuggestAutoCorrectionKey).

SearchCategoryIndexPipeline - Shared

GetIndexableCategories - Shared

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

MapSearchCategoryProperty - Shared

OrderPipeDescription
100MapSearchCategoryCustomPropertiesIf parameter.SearchBoost and parameter.PropertyDefinition are null and parameter.SearchBoost.IsQueryable and parameter.PropertyDefinition.IsCustomProperty are false continue to next pipe.

Using parameter.SearchBoost.DataType create a new FieldModel based on parameter.PropertyDefinition.Name and parameter.SearchBoost.Value.

Supported SearchBoost.SearchBoostPropertyDataType are Boolean, Keyword, Number, Text, and Date. Defaults to creating a Type of String and FieldType of "text" FieldModel.

SearchContentIndexerPipeline - Shared

CreateSearchContent - Shared

OrderPipeDescription
100CreateSpireIndexableSearchContentIf parameter.IndexableContentItem is not null continue to next pipe.

Creates a new SearchContent using the parameter object's fields and assigns it to result.SearchContent.

Fields that vary based on parameter.Language, persona are populated by filtering parameter.IndexableContentItem.Fields for the field with the appropriate context.
200CreateIndexableSearchContentIf parameter.IndexableContentItem is null continue to next pipe.

Creates a new SearchContent using parameter.IndexableContentItem fields and assigns it to result.SearchContent.

Fields that vary based on parameter.Language, persona are populated by filtering parameter.IndexableContentItem.Fields for the field with the appropriate context.

GetIndexableContentItems - Shared

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

Creates an Entity Framework query against PageVersion repositories using the parameter object's fields and assigns it to result.IndexableContentItems.

SearchProductIndexerPipeline - Shared

GetIndexableProducts - Shared

OrderPipeDescription
100GetIndexableProductsSqlStatementPartsIf parameter.BuildVersion isBuildVersion.Version2 continue to next pipe. If parameter.BuildVersion isBuildVersion.Version2 and result.CustomFields are not empty throws NotSupportedException.

Creates a string with the Insite default SQL query to get the correct products and fields from the database and assigns it to result.SqlStatement. Assigns result.IncrementalFilter with the proper SQL snippet if parameter.IsIncremental is true.
200CombineSearchIndexableProductsSqlStatementPartsIf parameter.BuildVersion isBuildVersion.Version2 continue to next pipe. Combines result.SqlStatement, result.CustomFields, and result.IncrementalFilter and assigns it to result.FormattedSqlStatement.
300PerformIndexableProductsSqlQueryIf parameter.BuildVersion isBuildVersion.Version2 continue to next pipe. Gets an IEnumerable using the SQL query from result.FormattedSqlStatement and assigns it to result.IndexableProducts.
400PerformIndexableProductsV2If parameter.BuildVersion is not BuildVersion.Version2 continue to next pipe. Gets an IEnumerable using internal SearchV2 logic and assigns it to result.IndexableProducts.

MapSearchProductProperty - Shared

OrderPipeDescription
100MapSearchProductCustomPropertiesIf parameter.SearchBoost and parameter.PropertyDefinition are null and parameter.SearchBoost.IsQueryable and parameter.PropertyDefinition.IsCustomProperty are false continue to next pipe.

Using parameter.SearchBoost.DataType create a new FieldModel based on parameter.PropertyDefinition.Name and parameter.SearchBoost.Value.

Supported SearchBoost.SearchBoostPropertyDataType are Boolean, Keyword, Number, Text, and Date. Defaults to creating a Type of String and FieldType of "text" FieldModel.