I have recently updated my packages from find.framework 8.2 to 8.7 and a lot of my code falls over such ApplyBestBets() now throws an error -
Error 205 Cannot implicitly convert type 'EPiServer.Find.ITypeSearch' to 'EPiServer.Find.IQueriedSearch'. An explicit conversion exists (are you missing a cast?)
. Have I missed anything?
I have updated the other packages to their latset versions too.
My guess is that you need to move the ApplyBestBets() so that your query is of IQueriedSearch type.
How does your query look at the moment?
Hi,Can you post your entire query call?/Henrik
Hi, thanks for looking into this for us - I have posted the code below:
.ProjectTitleFrom(x => x.Title);
//Create a search/query for the entered search text retrieved from the query string.
EPiServer.Find.IQueriedSearch query = SearchClient.Instance.UnifiedSearchFor(Query);
var queryStringQuery = (IQueriedSearch)query;
query = queryStringQuery.WithAndAsDefaultOperator();
//Include a facet for sections.
query = query.TermsFacetFor(x => x.SearchCategories, Facet => Facet.Size = 50)
.FilterFacet("AllSections", x =>
.Filter(x => x.MatchType(typeof(EPiServer.Templates.RCOG.Models.Pages.NewsArticleType)))
Is it correct to assume that the code included above originally said "var query" rather than "EPiServer.Find.IQueriedSearch query"?
If you were to change the declaration of the query variable to:
EPiServer.Find.ITypeSearch<ISearchContent> query = SearchClient.Instance.UnifiedSearchFor(Query);
that last reassignment of the query variable should be ok in 8.2 as well as later versions.
It's worth noting that an IQueriedSearch is an ITypeSearch, so it's really only the actual re-assignment of the query variable that is problematic, the sequence of extension method calls should be fine.
The change was made a few versions back as part of a fix of an inconsistency with the CMS variation of the UnifiedSearchFor extension and while that solved other problems it was an oversight that it was included without proper notification.
We're sorry about any problems caused by this!
Edit: The generic type was missing