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
Order | Pipe | Description |
---|---|---|
100 | InitializeSearchProperties | Maps parameters for SearchClient, SearchQueryBuilder, and SearchCategoryMapper into result. |
200 | GetSettings | Uses Dependency Injection to get instances of SearchGeneralSettings and FuzzySearchSettings, attaching to the result to be used during pipeline processing. |
300 | GetQueryFields | Uses Dependency Injection to get an instance of the IBoostHelper get searchBoosts for Category, attaching to the result to be used during pipeline processing. |
400 | FormPaging | Takes the parameter's StartRow and PageSize attaching to the result to be used during pipeline processing. |
500 | FormCategoryExcludeList | Attaches 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>) |
600 | FormCategoryExcludeFilter | Using result.DisallowedCategories List to filter out categories generated during FormCategoryExcludeList pipe processing. |
700 | FormLanguageFilter | UsingĀ result.SiteContext.LanguageDtoĀ to filter Search Results to a specific LanguageCode. If not processed, will include results from all Languages. |
800 | FormWebsiteFilter | Uses result.SiteContext.WebsiteDto to filter Search Results to a specific Website. If result.SiteContext.WebsiteDto is null, will cause Pipeline Exception/Error. |
900 | FormTypeFilter | Uses Parameter.AddTypeFilter will add a Query Filter for 'type' equaling 'category'. |
1000 | CombineFilters | CombinesĀ 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. |
1100 | FormMainSearchQuery | Creates a SearchQuery from result.CategorySearchFields against the parameter.Criteria query value for a MultiMatchQuery and MultiMatchPrefixQuery search type. |
1200 | FormFuzzySearchQuery | Creates a SearchQuery from result.CategorySearchFields against the parameter.Criteria query value for a MultiMatchFuzzyQuery search type. |
1300 | CombineQueries | CombinesĀ result.AllQueriesĀ into a singleĀ SearchQueryĀ with an Operation of 'Or' setting Query toĀ result.CombinedQuery. |
1400 | ApplyQueryAndFilter | Creates 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. |
1500 | ApplyPaging | SetsĀ FromĀ andĀ SizeĀ onĀ result.SearchDescriptor. |
1600 | ApplySortOrder | Creates SortDescriptor using the ISearchCategoryObject.SortOrder and SortOrderField.Score as fields that will be set as SortOrder.Descending. Sets on Sort of result.SearchDescriptor. |
1700 | PerformSearch | Performs result.SearchResult.Search(...) passing in parameter.IndexType and result.SearchDescriptor as arguments, saving result to result.SearchResponse. |
1800 | ProcessSearchResponse | Validates for null and IsValid details of result.searchResponse. Returns an Error PipelineResult when the results are not valid. |
ContentSearchPipeline - Shared
RunContentSearch - Shared
Order | Pipe | Description |
---|---|---|
100 | InitializeSearchProperties | Uses Dependency Injection to get instance of SearchGeneralSettings attaching to result.SearchGeneralSettings to be used during pipeline processing. |
200 | ValidatePageSize | Validates 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. |
300 | FormQuery | Makes 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. |
400 | FormFilter | Makes 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. |
500 | PerformSearch | If 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. |
600 | ProcessSearchResponse | If 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. |
700 | ProcessSearchResponseForAllAggregations | If 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. |
800 | ProcessSearchResponseFromResult | If 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
Order | Pipe | Description |
---|---|---|
100 | GetIndexFields | Looping through the parameter.FieldTypeList will create and add the properties as ModelField instances to result.CreateIndexDescriptor.FieldModelList. |
200 | GetIndexCategoryCustomPropertyFields | Using the IEntityDefinitionProvider to get the Category Definition and add all IsCustomProperty flagged Properties to result.CreateIndexDescriptor.FieldModelList. |
300 | GetIndexProductCustomPropertyFields | UsingĀ IBoostHelper.GetSearchBoostsĀ to getĀ ProductĀ SearchBoost Records and add all starting withĀ Field_attributes.Ā toĀ result.CreateIndexDescriptor.FieldModelList. |
400 | GetIndexProductAttributePropertyFields | Using the IEntityDefinitionProvider to get the Product Definition and add all IsCustomProperty flagged Properties to result.CreateIndexDescriptor.FieldModelList. |
ProductSearchPipeline - Shared
FormProductFilter - Shared
Order | Pipe | Description |
---|---|---|
100 | GetSettings | Uses Dependency Injection to get SearchGeneralSettings and ProductRestrictionsSettings; then assigns them to the result object. |
200 | FormWebsiteFilter | Sets 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. |
300 | FormLanguageFilter | If 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. |
400 | FormCategoryFilter | IfĀ 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. |
500 | FormBrandFilter | If 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. |
600 | FormProductLineFilter | IfĀ 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. |
700 | FormRestrictionGroupFilter | If 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. |
800 | FormAttributeValueFilter | If 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. |
900 | FormAllowedProductsFilter | IfĀ 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. |
1000 | FormPriceRangeFilter | IfĀ 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. |
1100 | FormProductIdFilter | If 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. |
1200 | FormProductNameFilter | If 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. |
1300 | FormProductErpNumberFilter | If 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. |
1400 | CombineFilters | Makes 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
Order | Pipe | Description |
---|---|---|
100 | GetRestrictionGroupFilterFromCache | Attempts 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. |
200 | GetDefaultVisibilityFilters | Makes 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. |
300 | GetWebsiteRestrictionGroupQuery | Creates an EntityFramework query calling GetActiveRestrictionGroupsAsNoTracking with the parameter.SiteContext.WebsiteDto.Id (the current website) and assigns it to result.WebsiteRestrictionGroupQuery. |
400 | GetWebsiteRestrictionGroups | UsesĀ 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. |
500 | GetCustomerRestrictionGroupIds | If 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. |
600 | GetShowOnlyRestrictionGroupIds | IfĀ 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. |
700 | GetShowRestrictionGroupIds | IfĀ 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. |
800 | GetHideRestrictionGroupIds | IfĀ 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. |
900 | FormShowOnlySubFilter | IfĀ 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. |
1000 | FormShowSubFilter | IfĀ 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. |
1100 | FormHideSubFilter | IfĀ 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. |
1200 | CombineFilters | IfĀ 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. |
1300 | AddRestrictionGroupFilterToCache | IfĀ result.RestrictionGroupFilterĀ is null continue to next pipe. AddsĀ result.RestrictionGroupFilterĀ to the cache based on the result fromĀ GetRestrictionGroupFilterFromCache.GetRestrictionGroupFilterCacheKey. |
FormChildProductsRestrictionGroupFilter - Shared
Order | Pipe | Description |
---|---|---|
100 | GetRestrictionGroupFilterFromCache | Attempts 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. |
200 | GetDefaultVisibilityFilters | Makes 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. |
300 | FormShowOnlySubFilter | IfĀ 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. |
400 | FormShowSubFilter | IfĀ 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. |
500 | FormHideSubFilter | IfĀ 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. |
600 | CombineFilters | IfĀ 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. |
700 | AddRestrictionGroupFilterToCache | IfĀ result.RestrictionGroupFilterĀ is null continue to next pipe. AddsĀ result.RestrictionGroupFilterĀ to the cache based on the result fromĀ GetRestrictionGroupFilterFromCache.GetRestrictionGroupFilterCacheKey. |
RunBrandSearch - Shared
Order | Pipe | Description |
---|---|---|
100 | InitializeSearchProperties | Uses 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. |
200 | FormProductFilter | Use the ProductSearchPipeline's FormProductFilter pipeline to get the product filter and assign it toĀ result.FormProductFilterResult. |
400 | GetQueryFields | UsingĀ 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. |
500 | FormQuery | Creates 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. |
600 | CombineQueries | Create aĀ BooleanQueryĀ with anĀ Operation.OrĀ for all non-nullĀ result.AllQueriesĀ attaching toĀ result.CombinedQuery. |
700 | FormBrandAggregation | IfĀ 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. |
800 | CombineFilters | If 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. |
900 | ApplyQueryAndFilter | Make 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. |
1000 | PerformSearch | Make 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. |
1100 | ProcessBrandAggregation | If 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. |
1200 | ProcessTopHitsAggregates | IfĀ 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(). |
1300 | SortAndLimitBrands | IfĀ 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. |
1400 | ProcessProductLines | IfĀ 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
Order | Pipe | Description |
---|---|---|
100 | InitializeSearchProperties | Uses 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. |
200 | FormProductFilter | Use the ProductSearchPipeline's FormProductFilter pipeline to get the product filter and assign it toĀ result.FormProductFilterResult. |
300 | FormQuery | IfĀ parameter.ProductFacetSearchParameter.BrandStartsWithĀ is blank continue on to next pipe. Make aĀ MultimatchPrefixQueryĀ forĀ parameter.ProductFacetSearchParameter.BrandStartsWithĀ against theĀ ISearchProductObject.BrandNameFirstCharacterĀ field. |
400 | FormBrandFilters | SetsĀ 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. |
500 | CombineFilters | If 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. |
600 | GetFacetField | Based 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. |
700 | FormAggregation | Set 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. |
800 | PerformSearch | Use result.SearchClient.Search to call a ISearchClient using result.IndexType and result.AggregationSearchDescriptor and assign the result to result.SearchResponse. |
900 | ProcessAggregation | LookupĀ 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>>. |
1000 | ProcessCategoryHits | IfĀ 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. |
1100 | ProcessBrandFirstCharacterHits | If 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. |
1200 | ProcessGenericHits | If 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
Order | Pipe | Description |
---|---|---|
100 | GetSettings | Uses 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. |
200 | InitializeSearchProperties | Uses 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. |
300 | FormSortOrder | PopulateĀ result.SortOrderFieldsĀ based onĀ parameter.ProductSearchParameterĀ fields. |
400 | ApplySortOrder | Creates a newĀ SortDescriptorĀ and set the sort based onĀ result.SortOrderFieldsĀ to theĀ result.SearchDescriptor. |
500 | GetQueryFields | Adds 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. |
600 | FormSearchCriteriaQuery | If 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. |
700 | FormCustomerNameQuery | If 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. |
800 | FormUrlSegmentQuery | Use the ProductSearchPipeline's FormProductFilter pipeline to get the product filter and assign it to result.FormProductFilterResult. |
900 | FormSearchWithinQuery | If 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. |
1000 | FormPreviouslyPurchasedProductQuery | If 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. |
1100 | FormStockedItemsOnlyQuery | If 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 |
1200 | CombineQueries | Create 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. |
1300 | FormProductFilter | Use the ProductSearchPipeline's FormProductFilter pipeline to get the product filter and assign it toĀ result.FormProductFilterResult. |
1400 | FormCategoryAggregation | If 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. |
1500 | FormBrandAggregation | If 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. |
1600 | FormProductLineAggregation | If 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. |
1700 | FormAttributeValueAggregation | If 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. |
1800 | FormPriceRangeAggregation | IfĀ 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. |
1900 | FormPersonaScoreFunctionList | IfĀ 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. |
2000 | FormFrequentlyPurchasedFunctionList | If 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. |
2100 | CombineAggregations | IfĀ 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. |
2200 | FormDidYouMeanSuggestion | If 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. |
2300 | FormAutoCorrectSuggestion | IfĀ 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. |
2400 | FormScoreExplanation | IfĀ parameter.ProductSearchParameter.GetScoreExplanationĀ isĀ trueĀ callsĀ result.SearchDescriptor.EnableExplain. |
2500 | CombineSuggestions | IfĀ 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. |
2600 | ApplySuggestion | IfĀ 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. |
2700 | PerformAggregationSearch | IfĀ 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. |
2800 | ProcessCategoryAggregation | IfĀ 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. |
2900 | ProcessBrandAggregation | IfĀ 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. |
3000 | ProcessProductLineAggregation | IfĀ 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. |
3100 | ProcessAttributeValueAggregation | UseĀ result.ProductSearchFacetProcessor.ProcessAttributeTypeFacetsĀ to process the facets fromĀ FormAttributeValueAggregation.AttributeValueAggregationKeyĀ andĀ FormAttributeValueAggregation.AllAttributeValueAggregationKeyĀ and assign the return value toĀ result.ProductSearchResult.AttributeTypeDtos. |
3200 | ProcessPriceRangeAggregation | IfĀ 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. |
3300 | PerformSponsoredSearch | If result.SponsoredSearchSettings.Enabled is false or parameter.IsAutocomplete is true or this is a filtered search or if this is not sorted by relevance or parameter.ProductSearchParameter.SearchCriteria is blank continue on to the next pipe. 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. |
3400 | ProcessSponsoredSearchResponse | If 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. |
3500 | ApplyQueryAndFilter | If 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. |
3600 | ApplyPaging | If 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. |
3700 | PerformSearch | Use result.SearchClient.Search to call a ISearchClient using result.IndexType and result.SearchDescriptor and assign the result to result.SearchResponse. |
3800 | ProcessSearchResponse | If 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. |
3850 | ProcessSearchResponsePagination | If 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. |
3900 | ProcessStyledProductSearchResponse | For 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. |
4000 | ProcessExplanation | If 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. |
4100 | ProcessDidYouMeanSuggestion | If 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. |
4200 | ProcessAutoCorrectSuggestion | IfĀ 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
Order | Pipe | Description |
---|---|---|
100 | GetIndexableCategoriesQuery | Creates an Entity Framework Category query using the parameter object's fields and assigns it to result.IndexableCategories. |
MapSearchCategoryProperty - Shared
Order | Pipe | Description |
---|---|---|
100 | MapSearchCategoryCustomProperties | If 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
Order | Pipe | Description |
---|---|---|
100 | CreateSpireIndexableSearchContent | IfĀ 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. |
200 | CreateIndexableSearchContent | IfĀ 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
Order | Pipe | Description |
---|---|---|
100 | GetIndexableContentItemQuery | Creates 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
Order | Pipe | Description |
---|---|---|
100 | GetIndexableProductsSqlStatementParts | If 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. |
200 | CombineSearchIndexableProductsSqlStatementParts | If parameter.BuildVersion isBuildVersion.Version2 continue to next pipe. Combines result.SqlStatement, result.CustomFields, and result.IncrementalFilter and assigns it to result.FormattedSqlStatement. |
300 | PerformIndexableProductsSqlQuery | If parameter.BuildVersion isBuildVersion.Version2 continue to next pipe. Gets an IEnumerable using the SQL query from result.FormattedSqlStatement and assigns it to result.IndexableProducts. |
400 | PerformIndexableProductsV2 | If 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
Order | Pipe | Description |
---|---|---|
100 | MapSearchProductCustomProperties | If 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. |
Updated almost 2 years ago