How can I get settings from 'Boosting' tab programatticaly?
I think you should be able to access them using:
You can also set them using conventions:
Actually, AutoBoost is used for document age and popularity, and not for the unified weights.
Here is a way to get the unified weights:
var unifiedWeightsQuery =
SearchClient.Instance.NewCommand(context => new UnifiedWeightsCommand(context, SearchClient.Instance.DefaultIndex));
UnifiedWeightsItem weights = unifiedWeightsQuery.Execute().Hits.FirstOrDefault();
Nice one, @Per Magne! :)
Hi Per Magne Skuseth,
Thanks for your solution
Is it possible to set weight to another property from UnifiedSearchHit (e.g. Section or Subsection)?
We can setup some values only for SearchTitle, SearchText, SearchSummary and SearchAttachment from UI boosting tab.
@Pavel, instead of using UnifiedSearchFor, you could do:
.InField(x => x.SearchSection,2)
and then add additional fields. You can then specify whatever boosting you would like - "2" in this case for SearchSection