Creating an Index
Create an index for a data source to improve search speed.
Implementation:
- Switch to the Definition panel.
- Click .
- In the Model Data Sources dialog select the data source whose index you want to examine, and click Index.
- Select the data source's primary key - or a suitable field to act as primary for your index - and click Set As Primary. The summary will update to show the field is now both Indexed and Primary.
- (Optional) If you want to set a field as the Title, select it and click Set As Title. Doing so will cause the values of that field to be returned as the titles of the respective search results. The summary will update to show the field is now both Indexed and the Title.
You can only have one Primary field and one Title field per index. Designating a primary or title field will remove that status from whichever field already has it, if there is one.
- Select the remaining fields you want to include in the index and click Set As Indexed.
- (Optional) To remove a field from the index, select it and click Remove as Indexed.
Removing a field from the index will also remove its Primary or Title status, if applied.
- (Optional) If you do not want to use the index's default Mask. for your search results, write your own into the text box below the field list. This mask is used to generate links based on your search results.
- Click the Start Indexing button. This opens the Search Index Location dialog.
- Use the radio buttons to specify the type of index you want to generate. Choosing Local Preview Index will generate an index suitable for use in the Preview Tool, whereas a Service Index can be deployed to a live web server.
- (Optional) Tick the Optimise This Index if you want to optimise the speed of searching. It can take a long time to optimise a large data set, but doing so can speed up your search results by a factor of 5.
- Click the Generate button. You will be asked to confirm the creation of the new index, so click Yes to start the process. At this point you will be returned to the Data Sources window, where you'll see the Generating Index indicator running in the bottom right-hand corner.
- When your full text search has been successfully created, click OK if you want to add search and search results controls to your model.
- (Local Preview Index only) Your full text index will be available in your Preview tool. Go to step 16.
- (Service Index Only) Click Publish Index, click OK to confirm the full text index files have been published to your web server.
If no web server has been configured for your repository you will need to contact your system administrator.
- Test the current index by switching to the Index Preview panel.
- Click one of the radio buttons at the top of the window to test the Local Index or the Production Index Service.
- Type a search string into the Search Index For field to perform a query on the index, and click Search.
Any indexed items containing an exact match will appear in the search results table, whose columns contain the following information:
- Link - The URL generated for the item, based on the index mask.
- Title - The value in the item's Title field.
- Summary - A string containing all indexed values in that item.
- Click Save.
You can also run indexed queries using the SearchDataSource function.