Radu
Radu

Reputation: 1066

'bool' does not contain a definition for 'Boost'

I'am trying to us boost function for busting some results in a sitecore search. You can see the code from bellow:

var predicate = PredicateBuilder.True<SearchResultItem>();
predicate = predicate.Or(p => p.Content.Equals(text).Boost(10));

When I use .Boost(10) I got the following error:

'bool' does not contain a definition for 'Boost' and no extension method 'Boost' accepting a first argument of type 'bool' could be found

What did I have done wrong? Or should I use some specific library?

Upvotes: 0

Views: 80

Answers (1)

Gatogordo
Gatogordo

Reputation: 2635

Put using Sitecore.ContentSearch.Linq; in your code. The extension method resides there.

Upvotes: 1

Related Questions