November Happy Hour will be moved to Thursday December 5th.

External best bets not working

Vote:
 

Hi,

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?

Thanks,

Mark

#217637
Feb 26, 2020 15:18
Vote:
 
#217638
Feb 26, 2020 15:31
Vote:
 

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.

#217644
Feb 26, 2020 21:18
Vote:
 

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?

#217676
Feb 27, 2020 13:25
Vote:
 

Hi Mark

Try something like

search = search.Filter(x => ((ContentPageBase)x).ExcludeFromSearchResults.Match(false) | x => (x as PageData).MatchType(typeof(ExternalUrlBestBet)));

or

search = search.Filter(x => ((ContentPageBase)x).ExcludeFromSearchResults.Match(false) | x => x.MatchType(typeof(ExternalUrlBestBet)));


                        
#217699
Feb 27, 2020 20:59
Vote:
 

All sorted now thanks to your suggestions and help. Much appreciated!

#217730
Feb 28, 2020 11:47
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.