Auto Complete

The SearchBox control can provide an AJAX based autocomplete as the user types a query (the suggestions are customizable). Please also see the code example

.NET 2, 3, 4

Set the AutoCompleteQuery property of the SearchResult control to True and AutoCompleteQueryIndexDirectory to the index directory to be used.

You should optimize the index after removing documents from the index to ensure AutoComplete suggestions are up-to-date.

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:

View Configuration Information For .NET 4

IIS 6

Add inside the system.web section.
<httpHandlers>
       <add verb="*" path="Keyoti.SearchEngine.Web.CallBackHandler.ashx" 
		 type="Keyoti.SearchEngine.Web.CallBackHandler,Keyoti4.SearchEngine.Web, 
			Version=2012.?.?.?, Culture=neutral, PublicKeyToken=58d9fd2e9ec4dc0e"/>
</httpHandlers>
where 2012.?.?.? should be replaced with the version number of the Keyoti4.SearchEngine.Web DLL.

IIS 7

Add inside the system.webServer section.
<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=2012.?.?.?, Culture=neutral, PublicKeyToken=58d9fd2e9ec4dc0e"/>
</handlers>
where 2012.?.?.? should be replaced with the version number of the Keyoti4.SearchEngine.Web DLL.

View Configuration Information For .NET 2 & 3

IIS 6

Add inside the system.web section.
<httpHandlers>
       <add verb="*" path="Keyoti.SearchEngine.Web.CallBackHandler.ashx" 
		 type="Keyoti.SearchEngine.Web.CallBackHandler,Keyoti2.SearchEngine.Web, 
			Version=2012.?.?.?, Culture=neutral, PublicKeyToken=58d9fd2e9ec4dc0e"/>
</httpHandlers>
where 2012.?.?.? should be replaced with the version number of the Keyoti2.SearchEngine.Web DLL.

IIS 7

Add inside the system.webServer section.
<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=2012.?.?.?, Culture=neutral, PublicKeyToken=58d9fd2e9ec4dc0e"/>
</handlers>
where 2012.?.?.? should be replaced with the version number of the Keyoti2.SearchEngine.Web DLL.

.NET 1.1

Set the AutoCompleteQuery property of the SearchResult control to True and AutoCompleteQueryIndexDirectory to the index directory to be used.

You should optimize the index after removing documents from the index to ensure AutoComplete suggestions are up-to-date.

Popular search suggestions are not available in .NET 1.1.

View Configuration Information For .NET 1.1

IIS 6

Add inside the system.web section.
    <httpHandlers>
       <add verb="*" path="Keyoti.SearchEngine.Web.CallBackHandler.ashx" 
		type="Keyoti.SearchEngine.Web.CallBackHandler,Keyoti.SearchEngine.Web, 
			Version=2012.?.?.?, Culture=neutral, PublicKeyToken=58d9fd2e9ec4dc0e"/>
    </httpHandlers>
where 2012.?.?.? should be replaced with the version number of the Keyoti.SearchEngine.Web DLL.

IIS 7


Add inside the system.webServer section.
<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, Keyoti.SearchEngine.Web,
	Version=2012.?.?.?, Culture=neutral, PublicKeyToken=58d9fd2e9ec4dc0e"/>
</handlers>
where 2012.?.?.? should be replaced with the version number of the Keyoti.SearchEngine.Web DLL.
Client side files
The installer automatically registers a virtual directory called Keyoti_SearchEngine_Web_Common which holds the necessary scripts. This is used by the AJAX features and needs to be present on the development and deployment machines.

Some AutoComplete Members

AutoCompleteQuery
Whether to provide auto-complete suggestions to the user as they type in the query text box.

AutoCompleteQueryFailSilent
Whether to show warning messages about errors - advised to set to false for development.

AutoCompleteQueryIndexDirectory
Location of the Index Directory to use for auto complete. Default is '~/IndexDirectory'.

AutoCompleteQueryMaxSuggestions
The maximum number of auto complete suggestions to make.

AutoCompleteQueryRunSearchOnSelect
Whether to automatically run the search when the user selects an auto complete item from the list.

AutoCompleteQueryShowNumberofResults
Whether to list the predicted number of results for each auto complete suggestion - adds server load when true.

AutoCompleteLoadPlugin
Whether to load any plugin DLL (as specified by Configuration.ExternalEventHandler) - this allows customization of the auto complete suggestions.

AutoCompleteQuerySuggestionSource
The source of data for auto-complete suggestions.

Query Suggestion Source

The source of data for auto-complete suggestions can be set using the AutoCompleteQuerySuggestionSource property.

IndexLexicon
Uses the lexicon from the index directory as set under AutoCompleteQueryIndexDirectory, for auto-complete suggestions.

PopularSearches
Previous search terms are used to provide auto-complete suggestions in order of popularity. The algorithm uses an attenuating window to keep new queries important and prevent the popular-search list becoming too large over time.
Note: The AutoCompleteQueryIndexDirectory must still be set.
Note: To prevent inappropriate suggestions and/or hijacking of suggestions by certain users, only words which are in the index lexicon will be offered as suggestions.


Note: Offensive words should not be added to the stop list as those words could appear as a suggestion if another user searches for them.

PopularSearchesAndLexicon (default)
A mix of the above where popular searches are favored, and if there are not enough suggestions from that source then additional suggestions are found from the lexicon.

Server farm synchronization

The popular search auto-complete source must synchronize all servers in a farm in order to function accurately (otherwise different servers will offer different suggestions). To do this, specify the IP (or server name) of every server in the farm in the SearchBox.ServerFarmSynchronizationIPs property, as a comma-delimited list. Eg. ServerFarmSynchronizationIPs="10.0.0.1,10.0.0.2,10.0.0.3". Doing so will allow servers to communicate with each other every 5 minutes with changes in search keyword data.

It is important the AutoCompleteQueryIndexDirectory is identical on each server, as this is used to identify the data being synchronized.