New answers tagged

0

By default, results are sorted by a "score" field. You can use this to your advantage by creating your own "boost" computed field and populating it according to your rules. Then, when fetching results, use OrderBy() and ThenBy() to sort them by "boost", then by "score" field, or the other way around as needed.


1

I think your not getting how this token is being executed. You are doing to check for a past event within the code (in your isPastEvent method) which is wrong as you are still converting the model from the input into something useable for the search api. At that moment you can (and are) working with the context item - which is not what you want. You want ...


0

After troubleshooting for many hours, we looked into the raw solr query for an effected item via the SOLR admin interface: query: _uniqueid:97338416-a07a-4f0b-8078-7437b192e0e7 that retured this raw field in the SOLR: "_path":["262cd6ec48c941f7834707930b0f0389", "72a997bbf0224cd7bc326ffcbfc00f9a", "...


0

You should make sure that your GetListOfStringFromFields method return not null value (to enable quering by empty list): public List<string> GetListOfStringFromFields(string fieldName) { var results = ...; // your existing logic to extract tag values return results ?? new List<string>{string.Empty}; // to store in solr empty list - ...


1

That approach is fine. You can create your token that can check on dates and use the current date. If you pass the date field name as a parameter you could reuse it as well. If you need some guidance on how to write this, I have blog post explaining that exactly: https://ggullentops.blogspot.com/2019/01/extending-sxa-search-query-tokens.html In short, you ...


0

You can loop through categories from the session and check if categories from the product contain any of them: var query = PredicateBuilder.And<ProductSearchItem>(); if (categories.Any()) { var categoryExpression = PredicateBuilder.False<ProductSearchItem>(); foreach (var category in categories) { categoryExpression = ...


Top 50 recent answers are included