Disclaimer: This website requires Please enable JavaScript in your browser settings for the best experience.

Dev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubDev 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.