Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

BoostMatch not working for category



So we have a recipe search page where an editor can choose e.g. christmas as the active category, and then we want all the recipes that are tagged with the category christmas to show up first.

I tried this: 

var searchResult = findClient.Search<RecipePage>(Language.Norwegian).BoostMatching(x => x.TypeCategory.Match(activeCategory.ToString()), 1).GetContentResult();

But it doesn't seem to work. It gives the exact same result as if I don't boost. If I filter on the same category, I get the recipes I want:

var searchResult = findClient.Search<RecipePage>(Language.Norwegian).Filter(x => x.TypeCategory.Match(activeCategory.ToString())).GetContentResult();

What am I doing wrong? Is there a better way to solve this?

Edited, Oct 09, 2019 15:41

Can you try these suggestions for Match() method and see if that work? Also, have try in find boost UI to check if you are getting desired results?

Oct 09, 2019 15:48


Is your Episerver Find index contains the "Norwegian" language indexes?

If not then you can try by enabling the "Norwegian" language in Find or pass the "Language.None" in the query.

Oct 10, 2019 9:41

Hi Torunn, 

Your code looks fine, but your boost weighting isn't enough to boost the results you're matching on I think. The docs state:

"The default property weight, 1, does not affect the score. A weight above 1 boosts the score if the information is found in a corresponding property. A weight smaller than 1 reduces the score." 

Change to 2 and see if that helps :)



Oct 10, 2019 15:26
Praful Jangid - Oct 14, 2019 12:02
Good catch..

It turned out to be what Paul suggested. I had misinterpreted the weighting, so I thought 1 was max. When I changed to 2, it worked.

Thanks everyone!

Oct 14, 2019 11:53
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.