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.