and reference KeyotiN.SearchEngine.Web.dll in your web pages that use the Web Controls (not required if using Javascript controls). The assemblies should be listed under "Extensions" in the Visual Studio add reference dialog, or can be browsed to under the install directory, eg C:\Program Files (x86)\Keyoti Inc\SearchUnit 2012\NETCLR_v4_BIN (use NETCLR_v2_BIN for .NET2).
The index directory will need to grant permission to the ASP.NET/IIS user that accesses it, see "Setup" in the index directory topic.
Copy Keyoti_SearchEngine_Web_Common folder from the SearchUnit install folder to your project.
The Javascript usage mode uses AJAX to communicate with the server over either WCF (for .NET 4 up) or ASP.NET Web Services (for .NET 2 up). When possible use WCF, as ASP.NET Web Services are now considered legacy by Microsoft.
By default Web API is used, via a Controller present in the Keyoti5.SearchEngine.Web.dll. To enable it, add the bold line in Startup.
public void ConfigureServices(IServiceCollection services) { services.AddControllers(); services.AddRazorPages(); services.AddControllers().AddApplicationPart(System.Reflection.Assembly.Load(new System.Reflection.AssemblyName("Keyoti5.SearchEngine.Web"))); }
By default WCF is used, via the SearchService.svc file in the Keyoti_SearchEngine_Web_Common folder. No extra configuration should be necessary.
Troubleshooting:
In the search page that uses the Javascript files, call (after the SearchUnit.js import) keyotiSearch.useWCFService = false;
<httpHandlers> <add verb="*" path="Keyoti.SearchEngine.Web.CallBackHandler.ashx" type="Keyoti.SearchEngine.Web.CallBackHandler,Keyoti4.SearchEngine.Web, Version=2015.?.?.?, Culture=neutral, PublicKeyToken=58d9fd2e9ec4dc0e"/> </httpHandlers>
<staticContent> <mimeMap mimeType="text/html" fileExtension=".ashx"/> </staticContent> <handlers> <add name="Keyoti_SearchEngine_Web_CallBackHandler_ashx" verb="*" preCondition="integratedMode" path="Keyoti.SearchEngine.Web.CallBackHandler.ashx" type="Keyoti.SearchEngine.Web.CallBackHandler, Keyoti4.SearchEngine.Web, Version=2015.?.?.?, Culture=neutral, PublicKeyToken=58d9fd2e9ec4dc0e"/> </handlers>
To enable the previewer, set the ResultPreviewerEnabled property of the SearchResult control to True.
Usually performed automatically: If the controls are opened in the VS designer, then the web.config will be amended with the required code. If this doesn't occur, then the web.config must be opened and the following changes made:
<httpHandlers> <add verb="*" path="Keyoti.SearchEngine.Web.CallBackHandler.ashx" type="Keyoti.SearchEngine.Web.CallBackHandler,Keyoti2.SearchEngine.Web, Version=2015.?.?.?, Culture=neutral, PublicKeyToken=58d9fd2e9ec4dc0e"/> </httpHandlers>
<staticContent> <mimeMap mimeType="text/html" fileExtension=".ashx"/> </staticContent> <handlers> <add name="Keyoti_SearchEngine_Web_CallBackHandler_ashx" verb="*" preCondition="integratedMode" path="Keyoti.SearchEngine.Web.CallBackHandler.ashx" type="Keyoti.SearchEngine.Web.CallBackHandler, Keyoti2.SearchEngine.Web, Version=2015.?.?.?, Culture=neutral, PublicKeyToken=58d9fd2e9ec4dc0e"/> </handlers>
<httpHandlers> <add verb="*" path="Keyoti.SearchEngine.Web.CallBackHandler.ashx" type="Keyoti.SearchEngine.Web.CallBackHandler,Keyoti.SearchEngine.Web, Version=2015.?.?.?, Culture=neutral, PublicKeyToken=58d9fd2e9ec4dc0e"/> </httpHandlers>
Add
<%@ Register TagPrefix="searchengine" Namespace="Keyoti.SearchEngine.Web" Assembly="Keyoti.SearchEngine.Web" %>
To do this, specify the IP (or server name) of every server in the farm in the web.config, using an appSetting named Keyoti-SearchEngine-ServerFarmSynchronizationIPs, its value should be a comma-delimited list. It is also necessary to specify an appSetting named Keyoti-SearchEngine-ServerFarmSynchronizationAppPath with a value indicating the relative URL of the app. Eg.
<appSettings> <add key="Keyoti-SearchEngine-ServerFarmSynchronizationIPs" value="10.0.0.1,10.0.0.2,10.0.0.3"/> <add key="Keyoti-SearchEngine-ServerFarmSynchronizationAppPath" value="/myapp/"/> </appSettings>
Doing so will allow each server to communicate with each other every 5 minutes with changes in search keyword data.