7

Solution 1 : You can create a constructor and then find it from there as follows - public IStorefrontContext StorefrontContext { get; set; } public ISearchManager SearchManager { get; set; } public YourController(IStorefrontContext storefrontContext, ISearchManager searchManager) { this.StorefrontContext = storefrontContext; this.SearchManager =...


3

I am assuming you are using the standard (ootb) search results component. That component is using rendering variants: $site/Presentation/Rendering Variants/Search Results The default rendering variants will show the title of the page (or the display name). If you want to show extra fields, you should create your own variant that displays this data. Note ...


3

I was able to accomplish this in a few steps in SXA 9.3. This approach implements the ISearchService included with SXA. We're basically extracting code that is used by the SearchController. Step 1 : Implement the custom search function. Add this to your IGenerateScribanContextProcessor. private delegate IEnumerable<Item> SearchItemsDelegate(Item item, ...


2

Facets work on fields. So you should have a field in your items that determines if the item is a product or an article (or ...). This could be the template, but that is rarely named as you want it. I solved a similar issue with a computed field. I added a computed field into my (sxa) index that contains the text you want as facet based upon the logic you ...


2

You need to check this part of the documentation: https://doc.sitecore.net/sitecore_experience_accelerator/setting_up_and_configuring/configuring/extend_search#_Extend_search_to_3 This explains how to use a link type field in the facets. Add a computed field and use that fieldname in the facet: Add the following definition to your search configuration file: ...


2

The Query Builder field does not support specifying a page size or offset. You can write your own code with the Content Search API where you first parse the Query Builder text and then add on the necessary calls to Take, Skip, Select to control what is returned.


2

It seems that PageList in this SXA version isn't using solr queries like search results component, if you take a look in Sitecore.XA.Feature.PageContent.Repositories.PageListRepository it makes a call to this.GetItems(this.Rendering, this.Rendering.Parameters["SourceType"], this.IsEdit). Depending on the Source Type set on the component (Children, ...


2

Pagelist and SearchResult might be used to show the same results (both coming from the index) but actually they work quite different. First difference is the way they work together with other components: the SearchResults are designed to work well with the other search components like the searchbox, the facet filters and so on. The Pagelist is not designed ...


1

You need to use the __Sortorder field to sort on. That is y default not in your index though so you need to add that as well. The explanation can be found in detail on this blog: https://www.sitecoreinsiders.com/sxa-search-results-sorting-by-sortorder-field/ In case that disappears, this is the short version: This field is being excluded from the index by ...


1

I don't think SXA provides this OOTB, we need to create QueryToken for Multlist With Search. The Multilist with Search field uses a SourceFilterBuilder class to parse its field source. Sitecore uses SourceFilterBuilderFactory to create the SourceFilterBuilder You can follow this blog - https://www.coreysmith.co/sxa-multilist-search-query-tokens/ Needs to ...


1

Add the Search Box rendering: To change the Search Box rendering properties, in the Search Box toolbar, click More, and click Edit component properties. In the Control Properties dialog box, select the specific page in the Search results page field. In the above screenshot, you can see, we have selected the Search page under the home node. Basically, you ...


1

This is achieved by imitating existing rules. Works as expected. string storeVisited = CookieHelper.GetCookie("VisitedStore"); WhenFieldAndQueryStringMatches<RuleBoostingContext> ruleCondition = args.RuleCondition as WhenFieldAndQueryStringMatches<RuleBoostingContext>; string operatorId = ruleCondition....


1

You can use Content Search API and apply FacetOn() method on IQueryable like this: context.GetQueryable<SearchResultItem>().Where(predicate).FacetOn(x => x[“Propery1Name”], 1).FacetOn(x => x[“Propery2Name”], 1).GetFacets(); While: Propery1Name is your Country field and Propery2Name is your City field You can reach more information in this ...


1

SXA has a custom pipeline called normalizeSearchPhrase which is removing all special characters from the search phrase. All the characters from this HashSet are removed: new HashSet<string> { "-", "+", "&", "|", "!", "{", "}", "[", "]", "^", "(&...


1

Did you use any custom SXA theme to achieve your search result? If yes then you need to try using the OOTB theme and check if the issue is still there. Or to resolve this issue you can update below line in component-search-query.js (/sitecore/media library/Base Themes/SearchTheme/Scripts/component-search-query) hashStr += key + "=" + ...


1

If it's purely presentational Dawid's answer in your link works perfect. However, if you want to display other fields for example you might be able to work with the Rules engine: Each individual field, section, Scriban etc. under the Variant Definition item has that field and can be utilized to make sure that does/doesn't render out depending on whether the ...


1

I can assume that the Assemble Name part in "BXS.XA.Foundation.Custom.Search.AggregatedContent, BXS.XA.Foundation.Custom.Search" does not exist in your solution. Please, check that your Assemble Name is correct. It has to have next format: {ClassNamespace}.{ClassName}, {AssembleName}


1

The GetModel() method is a virtual method of SXA AbstractRepository. Most of SXA repositories inherits from it, that is why we are overriding that method in a lot of places (as you probably noticed). What you need to do is to implement that method (as it comes from your interface) rather than override. The same with FillBaseProperties() method. That is a ...


1

Yes, SXA will replace all special characters with space. Those characters are: -, +, &, |, !, {, }, [, ], ^, (, ), ~, :, ;, /, \, ?, "". It is done in RemoveSpecialSearchCharactersProcessor processor from normalizeSearchPhrase pipeline. In terms of searching for word1 word2 you're also right, we will split the search phrase by space and add it ...


1

You will have to modify component-search-results-filter.js file. There is if (properties.multi) inside updateFacet function. If you will look inside there is another if if (currentFacet[0].type == "button") { for (i = 0; i < sig.length; i++) { // updating hash here } queryModel.updateHash(hash); // this is what should be ...


Only top voted, non community-wiki answers of a minimum length are eligible