Integrating the Coveo .NET Search in the Sitecore Content Editor
You can also integrate the Coveo search in the Sitecore Content Editor so that people contributing to the site content can also take advantage of the Coveo search features and more easily find information in the whole content, not just published content.
Note: The integration described in this topic works with Coveo .NET Front-End 12.0.61+.
Tip: Typically, a Sitecore site is managed with a Master database containing the whole content and a Web database containing only the published content. You can create separate sources for these two databases (see Configuring and Indexing a Sitecore Source topic in PDF), and then assign the Web source to the scope of the search interface integrated in the website, and the Master source to the scope of the search interface integrated in the Content Editor. This way, all of the unpublished content is searchable from the Sitecore Desktop.
To integrate the Coveo search in the Sitecore Content Editor
-
If not already done, install the Coveo Front-End components on your Sitecore server (see Installing Coveo .NET Front-End).
-
Install the Coveo Content Search for Sitecore:
-
Log in to the Sitecore Desktop user interface using an administrative account.
-
On the Sitecore Desktop, select Sitecore > Development Tools > Installation Wizard.
-
In the Installation Wizard dialog box:
-
In the Welcome to the Install Package Wizard screen, click Next.
-
In the Select Package screen:
-
Click Upload, and then browse the Coveo Master server to select the Coveo Content Search package distributed with CES:
[CES_Install_Path]\Bin\Sitecore6.0CoveoContentSearch2.zip
Note: Use the Sitecore6.0CoveoContentSearch.zip package only when you use the Sitecore legacy connector (see Sitecore Legacy Connector).
-
Click Next.
-
-
In the Ready to Install screen, click Install.
Note: If an Access Denied error is displayed for the bin_install folder while installing the package, verify the security permissions for ASP.NET in the bin folder of Sitecore or install the files manually.
-
-
Select the Restart the Sitecore client option, and then click Finish.
-
-
Using an administrator account, connect to your Sitecore server.
-
Create the Coveo virtual directory:
-
Open IIS.
-
In IIS, locate and right-click the website that corresponds to your Sitecore instance, and then select Add virtual directory.
-
In the Create Virtual Directory dialog box:
-
In the Alias box, enter Coveo.
-
In the Physical path box, enter [.Net_Front-End_Path]\Web\Coveo, typically C:\Program Files\Coveo .NET Front-End 12\Web\Coveo.
-
-
Close IIS.
-
-
Using a text editor, edit the Sitecore web.config file:
Example: For an instance named Sitecore, the file is located in the C:\inetpub\wwwroot\Sitecore\WebSite folder.
-
Copy the following code and paste it just before the </configSections> tag.
<sectionGroup name="coveoCnlWeb"> <section name="customContent" type="System.Configuration.SingleTagSectionHandler, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> </sectionGroup> <sectionGroup name="coveoEnterpriseSearch"> <section name="database" type="System.Configuration.SingleTagSectionHandler, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <section name="analytics" type="System.Configuration.SingleTagSectionHandler, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <section name="locations" type="System.Configuration.SingleTagSectionHandler, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <section name="server" type="System.Configuration.SingleTagSectionHandler, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> </sectionGroup>
-
Copy the following code and paste it just before the </controls> tag, a child of the <pages> tag.
<add tagPrefix="cnla" namespace="Coveo.CNL.Web.Ajax" assembly="Coveo.CNL.Web, Version=12.0.0.0, Culture=neutral, PublicKeyToken=44110d16825221f2"/> <add tagPrefix="cnlb" namespace="Coveo.CNL.Web.BetterControls" assembly="Coveo.CNL.Web, Version=12.0.0.0, Culture=neutral, PublicKeyToken=44110d16825221f2"/> <add tagPrefix="cnlm" namespace="Coveo.CNL.Web.Misc" assembly="Coveo.CNL.Web, Version=12.0.0.0, Culture=neutral, PublicKeyToken=44110d16825221f2"/> <add tagPrefix="cnlv" namespace="Coveo.CNL.Web.Validators" assembly="Coveo.CNL.Web, Version=12.0.0.0, Culture=neutral, PublicKeyToken=44110d16825221f2"/> <add tagPrefix="cnlvs" namespace="Coveo.CNL.Web.Validators.ServerSide" assembly="Coveo.CNL.Web, Version=12.0.0.0, Culture=neutral, PublicKeyToken=44110d16825221f2"/> <add tagPrefix="cnlw" namespace="Coveo.CNL.Web.Widgets" assembly="Coveo.CNL.Web, Version=12.0.0.0, Culture=neutral, PublicKeyToken=44110d16825221f2" /> <add tagPrefix="ces" namespace="Coveo.CES.Web.Search.Controls" assembly="Coveo.CES.Web.Search, Version=12.0.0.0, Culture=neutral, PublicKeyToken=44110d16825221f2"/> <add tagPrefix="cs" namespace="Coveo.CES.Web.Search.Controls.CustomerService" assembly="Coveo.CES.Web.Search, Version=12.0.0.0, Culture=neutral, PublicKeyToken=44110d16825221f2" />
-
Copy the following code and paste it just before the </namespace> tag, a child of the <namespaces> tag.
<add namespace="Coveo.CES.Web.Search"/> <add namespace="Coveo.CES.Web.Search.Controls" /> <add namespace="Coveo.CNL.Web" />
-
Copy the following code and paste it just before the </assemblies> tag, a child of the <compilation> tag.
<add assembly="Coveo.CNL, Version=12.0.0.0, Culture=neutral, PublicKeyToken=44110d16825221f2"/> <add assembly="Coveo.CES.Common, Version=12.0.0.0, Culture=neutral, PublicKeyToken=44110d16825221f2" /> <add assembly="Coveo.CNL.Web, Version=12.0.0.0, Culture=neutral, PublicKeyToken=44110d16825221f2"/> <add assembly="Coveo.CES.Web.Search, Version=12.0.0.0, Culture=neutral, PublicKeyToken=44110d16825221f2"/>
-
Copy the following code and paste it at the end of the file, just before the </configuration> tag.
<coveoCnlWeb> <customContent uri="~/Coveo/" anonymousUri="~/Coveo/Anonymous/"/> </coveoCnlWeb> <coveoEnterpriseSearch> <server hostname="localhost" port="52800"/> <database enabled="false" connectionString="mongodb://localhost/databaseName"/> <analytics enabled="false" connectionString="Data Source=yourServerName;Initial Catalog=CoveoAnalytics;Integrated Security=SSPI;"/> </coveoEnterpriseSearch>
-
Save the file.
-
-
When CES and Sitecore are not installed on the same server, copy the index certificate file from the Coveo Master server to the Sitecore server:
-
Using an administrator account, connect to the Coveo Master server.
-
Copy the index certificate file [Index_Path]\Config\Certificates\cert-iis.p12, typically C:\CES7\Config\Certificates\cert-iis.p12.
-
Paste the certificate file on the Sitecore server into the Sitecore instance website.
Example: For an instance named Sitecore, the default path is C:\inetpub\wwwroot\Sitecore\Website. You can also rename the certificate file such as ces-certificate.p12.
-
-
Configure the connection to the CES index. Using a text editor:
-
Open the Sitecore instance web.config file.
-
Under the <coveoEnterpriseSearch> tag, edit the <server> tag to include the following attributes:
-
hostname=”MyCoveoMasterServerHostName”
where you replace MyCoveoMasterServerHostName with the name of your Coveo Master server or localhost when CES and Sitecore are on the same machine. -
sslCertificatePath=”C:\inetpub\wwwroot\Sitecore\Website\ces-certificate.p12”
, ensuring that the path points to your certificate file. -
port=”52800”
, the default CES port number.
Example: When CES and Sitecore are on the same server.
<server hostname="localhost" port="52800" servicesHostname="localhost" servicesPort="52810" instance="default" mirrorName="default" sslCertificatePath="C:\Program Files\Coveo .NET Front-End 12\Web\ces-certificate.p12"/>
-
-
-
Configure the Sitecore source used by Coveo search:
-
Using a text editor, open the CoveoSearch.aspx file.
Example: For a Sitecore instance named Sitecore, the file is typically located in the C:\inetpub\wwwroot\Sitecore\Website\sitecore\shell\Applications\Coveo\ folder.
-
Locate the following code:
/* UNCOMMENT THIS SECTION BEFORE FIRST USE p_Args.Builder.AddConstantExpression("@Source=MySourceName"); */
and replace it with:
p_Args.Builder.AddConstantExpression("@Source=\”YOUR SITECORE SOURCE NAME HERE\”");
where you replace YOUR SITECORE SOURCE NAME HERE by the name of the source you created to contain the whole Sitecore content, typically indexing the master database.
-
Save and close the file.
-