Quantcast
Channel: Using Optimizely Platforms
Viewing all articles
Browse latest Browse all 8020

Find - Error when clicking search result but result loads correctly

$
0
0

Hi,

We have a search page which uses Find and I am seeing an error when the user clicks a search result but the actual page the result is for loads as expected. 

The search is UnifiedSearch and we loop through the UnifiedResults in the view and use document.Url to show the link to the result. When you hover over the result there are additional paramters appended to the result which I believe are there as we have statistics enabled.

When you click on a result it seems to trigger another search, I assume as a result of the paramters? It's this second search that triggers an error behind the scenes however the page for the search result loads as expected and does not have the additional parameters appended to the Url.

The error that is raised is:

"The extension method 'For' must be called before the query has been otherwise set"

and the stack trace for this is:

System.InvalidOperationException: The extension method 'For' must be called before the query has been otherwise set
at EPiServer.Find.TypeSearchExtensions.<>c__DisplayClass1_0`1.<For>b__0(ISearchContext context)
at EPiServer.Find.Search`2.ApplyActions(ISearchContext searchContext)
at EPiServer.Find.Search`2.ApplyActions(ISearchContext searchContext)
at EPiServer.Find.Search`2.ApplyActions(ISearchContext searchContext)
at EPiServer.Find.Search`2.ApplyActions(ISearchContext searchContext)
at EPiServer.Find.Search`2.ApplyActions(ISearchContext searchContext)
at EPiServer.Find.Search`2.ApplyActions(ISearchContext searchContext)
at EPiServer.Find.Search`2.ApplyActions(ISearchContext searchContext)
at EPiServer.Find.Search`2.ApplyActions(ISearchContext searchContext)
at EPiServer.Find.Search`2.ApplyActions(ISearchContext searchContext)
at EPiServer.Find.Search`2.ApplyActions(ISearchContext searchContext)
at EPiServer.Find.Search`2.ApplyActions(ISearchContext searchContext)
at EPiServer.Find.Search`2.ApplyActions(ISearchContext searchContext)
at EPiServer.Find.Search`2.ApplyActions(ISearchContext searchContext)
at EPiServer.Find.Search`2.ApplyActions(ISearchContext searchContext)
at EPiServer.Find.SearchExtensions.GetResult(ITypeSearch`1 search, HitSpecification hitSpecification, Boolean filterForPublicSearch)

Has anyone encountered this before and know how to prevent an additional search or the error happening?

Thanks,

Mark


Viewing all articles
Browse latest Browse all 8020

Trending Articles