Gravatar for bberriz@lifeextension.com

Question by Ben, Jan 5, 2016 12:12 PM

Could not find add method: ExcludeField

I am in the process of upgrading Coveo and Sitecore. I am on Sitecore 8.1 update 1, version 151207. For Coveo, I am on 3.0.1188. This includes Coveo for Sitecore 81 3.0 (1188).zip, Coveo Enterprise Search 7.0 x64 (8047) for Sitecore, and Coveo Search API 8.0.893. CES and the Coveo API are running on a remote server. All 3 Coveo components have been installed successfully. I have also modified our Coveo.SearchProvider.config and Coveo.SearchProvider.Rest.config accordingly. Inside Sitecore, when trying to bring up the indexing manager inside control panel, I get the following

[RequiredObjectIsNullException: Could not find add method: ExcludeField (type: Sitecore.ContentSearch.DocumentBuilderOptions)]
   Sitecore.Configuration.Factory.AssignProperties(Object obj, Object[] properties) +1635
   Sitecore.Configuration.Factory.AssignProperties(XmlNode configNode, String[] parameters, Object obj, Boolean assert, Boolean deferred, IFactoryHelper helper) +759
   Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +296
   Sitecore.Configuration.Factory.GetInnerObject(XmlNode paramNode, String[] parameters, Boolean assert) +117
   Sitecore.Configuration.Factory.AssignProperties(XmlNode configNode, String[] parameters, Object obj, Boolean assert, Boolean deferred, IFactoryHelper helper) +577
   Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +296
   Sitecore.Configuration.Factory.CreateObject(String configPath, String[] parameters, Boolean assert) +666
   Sitecore.Configuration.Factory.CreateFromReference(XmlNode configNode, String[] parameters, Boolean assert) +198
   Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +118
  Sitecore.Configuration.Factory.GetInnerObject(XmlNode paramNode, String[] parameters, Boolean assert) +117
   Sitecore.Configuration.Factory.AssignProperties(XmlNode configNode, String[] parameters, Object obj, Boolean assert, Boolean deferred, IFactoryHelper helper) +577
   Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +296
   Sitecore.Configuration.Factory.GetInnerObject(XmlNode paramNode, String[] parameters, Boolean assert) +1090
   Sitecore.Configuration.Factory.AssignProperties(XmlNode configNode, String[] parameters, Object obj, Boolean assert, Boolean deferred, IFactoryHelper helper) +577
   Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +296
   Sitecore.Configuration.Factory.CreateObject(String configPath, String[] parameters, Boolean assert) +666
   Sitecore.ContentSearch.ContentSearchManager.get_SearchConfiguration() +261
   Sitecore.ContentSearch.Client.Forms.IndexingManagerWizard.BuildIndexes() +163

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
   System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +76
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +211
   System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) +35
   Sitecore.Web.UI.Sheer.ClientPage.OnLoad(EventArgs e) +337
   System.Web.UI.Control.LoadRecursive() +71
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3178

When browsing the Sitecore.ContentSearch.dll, an ExcludeField method does not exist in the Sitecore.ContentSearch.DocumentBuilderOptions type. This method exists in the ProviderIndexConfiguration type in the Sitecore.ContentSearch.dll. Switching to this class in the SearchProvider.config, gives another error, and seems like the wrong approach.

Please advise.

Thanks

1 Reply
Gravatar for slangevin@coveo.com

Answer by Simon, Jan 5, 2016 4:38 PM

Hi,

Have you upgraded from 8.0 to 8.1 ?

Your analysis of the content of the dlls is indeed correct. The ExcludeField method of the ProviderIndexConfiguration is deprecated in Sitecore 8.1 and should be replaced by AddExcludedField of the DocumentBuilderOptions.

This said, we use this method in the CoveoSearchProvider.config, so simply open your config and search/replace ExcludeField to AddExcludedField.

The example file is correct, but if you upgraded with an existing file, you need to change it manually.

Cheers,
Simon

Gravatar for bberriz@lifeextension.com

Comment by Ben, Jan 6, 2016 11:27 AM

Yes, this is all in an attempt to upgrade Sitecore to 8.1. Changing the field name worked for us. But now, attempting to view indexes, we receive a new error, but idk if this stack is useful:

[NullReferenceException: Object reference not set to an instance of an object.]
   Coveo.SearchProvider.ProviderIndexBase.Initialize(IIndexDocumentPropertyMapper`1 p_DocumentTypeMapper) +2321
   Coveo.SearchProvider.ProviderIndex.Initialize() +131

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
   System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +76
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +211
   System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) +35
   Sitecore.Configuration.Factory.AssignProperties(Object obj, Object[] properties) +832
   Sitecore.Configuration.Factory.AssignProperties(XmlNode configNode, String[] parameters, Object obj, Boolean assert, Boolean deferred, IFactoryHelper helper) +759
   Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +296
   Sitecore.Configuration.Factory.CreateObject(String configPath, String[] parameters, Boolean assert) +666
   Sitecore.ContentSearch.ContentSearchManager.get_SearchConfiguration() +261
   Sitecore.ContentSearch.Client.Forms.IndexingManagerWizard.BuildIndexes() +163

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
   System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +76
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +211
   System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) +35
   Sitecore.Web.UI.Sheer.ClientPage.OnLoad(EventArgs e) +337
   System.Web.UI.Control.LoadRecursive() +71
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3178
Gravatar for slangevin@coveo.com

Comment by Simon, Jan 6, 2016 11:43 AM

Attempting to view the indexes in the Indexing Manager? Are the Sitecore logs a but more verbose?

Gravatar for jflheureux@coveo.com

Comment by Jean-François L'Heureux, Jan 6, 2016 12:14 PM

Hi, did you follow the upgrade documentation? https://developers.coveo.com/pages/viewpage.action?pageId=31916089

There's a lot of configuration nodes that have changed locations and types in the December 2015 release of Coveo for Sitecore. You seem to have all the old nodes in your configuration.

You are better to start from out of the box December 2015 Coveo.SearchProvider.config and Coveo.SearchProvider.Rest.config files and merge your old customizations in them.

Gravatar for bberriz@lifeextension.com

Comment by Ben, Jan 6, 2016 2:07 PM

@jflheureux That was the attempt we made. Let us verify that our configs are matching up, then we'll get back to you. @Simon I will check the logs for a better account of what is going on, with the first error the logs gave no extra information.

Gravatar for bberriz@lifeextension.com

Comment by Ben, Jan 6, 2016 2:49 PM

We checked over the configs and everything matches where it should. The logs show the same error we see on the screen.

Gravatar for slangevin@coveo.com

Comment by Simon, Jan 6, 2016 2:56 PM

The error is pretty generic is stretching away from the original subject of the question. Could you please open a support case?

Ask a question