Ref, boosting documentation: http://world.episerver.com/documentation/developer-guides/find/NET-Client-API/searching/Boosting-with-filters/
How can I boost string properties (a hit inside Heading and SubHeading is more relevant than MainIntro).
I have tried the code below, but that has no effect. If I use a bool property, it works as expected.
var result = SearchClient.Instance.Search()
.BoostMatching(x => x.Heading.Match(query), 2)
.BoostMatching(x => x.SubHeading.Match(query), 2)
I have also tried MatchContained(..), but the result order is unchanged.
Would it not be better to boost the fields? Such as .InField(x => x.Heading, 2) That way it would work with stemming as well, and not just an exact match.
Also, are you sure you tested with an exact match? Remeber that .Match is case sensitive. :-)
So the reason why it doesn't work is this:
The Match method is only for exact matches and the MatchContained does the same, but on complex objects. When using filter methods the content is not analyzed. Therefore it is not possible to filter on tokens inside the fields.
I used your approach instead. Thanks, PM ;)