We have on premise Find and it seems that external best bets are not working.
I set up an external best bet and when searching for the phrase this best bet is not returned. Note that internal best bets are working as expected and we are using .ApplyBestBets() in the code.
I can see an ExternalUrlBestBet in the backend index but all it has is a type and a GUID Id, so I guess it could not be indexing correctly?
Is there anything obvious that I'm missing?
Hi Mark,This forum thread concerns external Best Bets - maybe it can help: https://world.episerver.com/forum/developer-forum/EPiServer-Search/Thread-Container/2017/12/how-does-external-best-bets-works-/
If you are using GetContentResults() it won't work as it will only return/filter on IContent.
Should work if you Filter / MatchType on ExternalUrlBestBet.
Hi, thanks to both of you for your replies.
We had some filters that exclude results based on content property values, commenting these out returns the external best bets.
The only problem is that we need these filters in place as the content properties allow editors to exclude content from the search results.
An example of one of the filters is
search = search.Filter(x => ((ContentPageBase)x).ExcludeFromSearchResults.Match(false));
We have the same for images and media as well.
Any suggestions on how to include these filters and allowing the external best bets to be returned?
Try something like
search = search.Filter(x => ((ContentPageBase)x).ExcludeFromSearchResults.Match(false) | x => (x as PageData).MatchType(typeof(ExternalUrlBestBet)));
search = search.Filter(x => ((ContentPageBase)x).ExcludeFromSearchResults.Match(false) | x => x.MatchType(typeof(ExternalUrlBestBet)));
All sorted now thanks to your suggestions and help. Much appreciated!