Try our conversational search powered by Generative AI!

Best Bets clashing with filter

Nat
Nat
Vote:
 

is there anyway to ensure that a best bet is not filtered out by another filter.

I have this, and a number of other filters: 

var collectionFilter = search.Client.BuildFilter<T>();
if (collection.ParentPages.Any())
{
    foreach (var pageReference in collection.ParentPages)
    {
        collectionFilter = collectionFilter.Or(x => ((IContent)x).Ancestors().Match(pageReference.ToString()));
    }
}
search = search.Filter(collectionFilter);

which when used, seems to stop including BestBets.

var query = Client.Search<IContent>(stemmingLanguage)
                .For(searchTerm)
                .WithAndAsDefaultOperator()
                .ApplyBestBets()
                .CustomFilters() // a number of them really
                .Select(x => new MyCustomObject{.....)
                .GetResult();

clearly missing something, but not seeing what it is.

seems that 

.FilterOnCurrentSite()

also stops best bets being returned, certainly when they are in another multisite instance. is there any way of getting best bets to be returned when used with filteroncurrentsite and when they reside in another site on the multisite instance.

likewise, how do I get externalBestBets out in the same instance.

thanks

#272214
Edited, Feb 15, 2022 9:07
* 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.