SitecoreUtilities.ToCoveoFieldName p_index = null
Using Coveo for Sitecore and MVC.
I have been able to successfully obtain the field name on a number of pages within my site using:
var fieldName = SitecoreUtilities.ToCoveoFieldName("lowecasefieldname");
But for one page in particular I'm getting the error:
Precondition failed: The parameter 'p_Index' must not be null Parameter name: p_Index
Baffled as to why this is working on other pages and not this page.
I have cshtml markup for the non working page and working page and can't see the difference.
I read another comment suggesting to reference the Iindexable to point to the correct index but not sure how to go about this?
Any help appreciated. Thank you.
In Coveo for Sitecore MVC views, the model contains a helper for the
ToCoveoFieldName method. You can call it with:
This helper will automatically resolve the name of the index to use by looking at the Sitecore context current site database. It will try to find the first Sitecore index of the Coveo type that is configured to index that database.
So if the page using your non-working view is from a different Sitecore site configuration and this site uses a database that is not indexed by Coveo, it could be the cause of your issue.