New answers tagged

1

The solution to this is to use the following function overload: ContentSearchResult[ObjectIndexerKey key]. Example Query: queryable = queryable.Where(p => ((DateTime)p[(ObjectIndexerKey)"Date"]) > lastWeek.Boost(4f) ); Note: The boost above does not appear to be translated in the query


1

To filter suggestion result only particular path, there is three possible solutions: Option 1: Set contextField as _fullpath and pass path in ContextFilterQuery <str name="contextField">_fullpath</str> using (var context = ContentSearchManager.GetIndex("sitecore_master_index").CreateSearchContext()) { ...


0

You can set indexType as UNTOKENIZED which means "Phrases will be stored as a whole – the entire value of the field, essentially" so it will consider 17-H as a single word instead of break into different words. You can do like below: <field fieldName="displayname" storageType="YES" indexType="UNTOKENIZED" />


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

Unfortunately, this doesn't work in Sitecore 9.3: https://doc.sitecore.com/en/developers/93/platform-administration-and-architecture/search-result-boosting.html You can store the viewsCount in an indexed field and sort by it. Or move away from LINQ and directly query Solr.


2

I was not able to find the direct cause of this issue but I have found a possible solution. When using the Like function with the slop parameter Like<T>(this T value, string phraseComparison, int slop), it formats the query correctly without the backslashes. From the logs: _content:("Test query Test test"~1) I believe the phrase query is ...


0

You can also create Solr queries directly and run them against SOLR through a GET call. Gives you a lot more control and flexibility. Could be a rather big change though for your project. https://lucidworks.com/post/use-solr-boost-function/


Top 50 recent answers are included