This article will help you with the configuration of full-text search in the Lite web client.
- Project created with Professional or Ultimate edition of the desktop product
- Physical or virtual server environment with Windows OS and the desired connectivity
- Server product with valid licenses (server and lite license files)
- Self signed or official SSL certificate
The server is able to create full-text search indexes of existing business objects, which are used by the web viewer to provide the user with advanced search capabilities.
The full-text search is fully configurable using the desktop client to create the search configuration and the server to create the full-text search indexes and expose the full-text search service for Lite web viewer to use.
Configure Search Collections
To make a business object available for full-text searching a new business object has be created with a fixed set of fields. This can be done by creating a new business object using the same source collection(s) as the business object that needs to be indexed, or duplicate that business object and replace all the fields with the required fields for the indexing service.
The following fields need to be present in order to get processed by the indexing service:
This is the main search category of the full-text search index. In the Lite web viewer the user selects a main category from the drop-down to search in. You can use the same category name for multiple search business objects to combine results, or you can split one search business object into multiple categories using expressions.
These are the category filters that can be used by the user to narrow down the search results. The filter should be entered as “filtername=filtervalue” e.g. “Type=” + PubRestautant.Type.
Multiple filters can be entered and need to be separated by semi-colons (;)
These are all the keywords the user can enter so search for a feature. Each word should be separated by a space.
E.g. PubRestaurant.Name + " " + PubRestaurant.Street + " " + Town.Name
This field contains the user friendly description for a feature and is displayed in the search results.
E.g. PubRestaurant.Name + " (" + PubRestaurant.Cuisine + " on " + PubRestaurant.Street + ", " + Town.Name + ")"
This is the reference to the original business object and is used in the Lite web viewer for selecting the correct feature and displaying the properties of that feature. The reference is optional, when left empty the user can jump to the location of the search result feature but properties are not displayed. To make the reference work in Lite the field needs to be formatted as follows:
Concat("B|internal name of the business object|", key value 1, "|", key value 2)
The business object used in the reference should be the original business object this search is for, not the name of the search business object. All the key field values of the original business object should be entered, separated by the pipe (|) symbol. If the original business object has no key values then no reference can be set.
This field is used to determine location of the search feature and is used to jump to the right location on the map.
Order of the fields is not important, also additional fields may be added but will be ignored by the indexing service.
The result should be something like this:
- Search category
- Category filter
- Search results
- Location of the selected search result
- Properties of the selected search result
Create or Update an Index
To create or update a full-text search index make sure you have configured one or more search business objects as explained in Configure Search Collections.
Start the server with the project containing the search business objects and go the management application. In the management application go to the Tasks tab and add the Create Full-Text Search Index task.
The physical folder where the full-text search index needs to be created. When the folder contains an existing index, this index is used. When the folder contains no index, a new index is created.
The configured search business collections that need to be indexed. Multiple collections can be indexed at the same time use a semi-colon (;) as the separator.
Flag to indicate if an existing index needs to be cleared (all entries deleted). As the indexing service does not support updating existing entries (incremental changes), the setting should only be disabled if you add a new search business collection to the index. This means a business collection that has not been indexed yet, thus containing no entries in the index at the specified location. In all other cases enable this settings, avoiding double records or unwanted search results. For new indexes this setting is ignored.
Enter a semi-colon (;) separated list of keywords that should not be indexed.
Create Spatial Index
Enable this setting if you want to enable the user to restrict the search results by the current map extent. When enabled all feature geometries in the full-text search index will be spatially indexed. This will have some impact on the physical size of the index and on the indexing performance.
Fill in the required parameters and run the task. During indexing the server writes the indexing progress to the logfile. Check the server log when the task is finished to see the indexing task results.
After a full-text search index is created or updated, the server will pick up this changes automatically (can take up to 5 minutes before these changes are visible). There is no need to restart the server.
Configure the Indexing Service
The server exposes the full-text search service which can be used by external application.
To configure the full-text search service, open the management application of the server and go to the services section on the server tab.
The following settings can be configured for the full-text search service
A semicolon (;) separated list of keywords that are ignored when a user performs a search.
The physical location of the folder containing the full-text search index. Default Results The default number of search results to return when a search request has not specified the number of results to return.
The maximum number of search results to return. When a search request has specified a higher amount of result to return, this maximum is used.
In the Lite application each search category has a default icon. This icon can be changed by specifying the category name with an icon name e.g. infrastructure=road. Multiple categories can be added using a semi-colon (;) as the separator e.q. infrastructure=road;leisure=beer
Available icon names can be found here: http://icofont.com
When the service is started, the server log will show some information about the full-text service like index location and categories present in the index.