Quick Search Configuration
Here are a few options to customise and configure Quick Search.
- Select your map first (Maps > Select Map > mapName).
- Now create your search(es) (Searches > Add Search).
Multiple searches can be selected for inclusion in the map.OSGB 50k Gazetteer and WorldSearch are included as default searches with WebMap installation.
Search results are not numerically ordered if your Search is a text field in the database.
However if you are using AddressBase Plus from the Ordinate Survey, you can order by column name “PAO_START_NUMBER” to show results that are numerically ordered from 1-10.
The number of results returned by Quick Search is controlled in the map.aspx page.
This feature is not supported if Quick Search data resides in an Access database.
Open the map.aspx file in a text editor and locate the section:
<Cadcorp:QuickSearch runat=”server”
Now edit these four parameters:
- MinimumCharactersBeforeSearch controls the minimum number of characters to be entered before a search is carried out.
- Delay controls the wait time (msec) before commencing a search when the minimum number of characters has been entered.
- InitialAmountOfResultsToFetch controls the initial number of results returned.
- ExtraResultsToFetch controls the number of extra results returned when the user chooses to “show more” results.
Delay="500"
MinimumCharactersBeforeSearch="3"
ExtraResultsToFetch=”10”
InitialAmountOfResultsToFetch=”4”
The numbers shown are default values; simply edit them as needed and save map.aspx to apply changes.
To speed up returned results from Quick Search, create an index. Indexes are created on the column you wish to search.
Indexing allows correct data retrieval without having to check every row in the table.
Note: If you are adding a search using data stored in a PostGIS table, convert the column into vector BEFORE creating an index.
Cadcorp SIS WebMap uses a ‘like’ clause to search the database. However there are certain restrictions in using the index of a standard PostGIS column when a like clause is used.
Run a SQL statement in your database manager (this statement will depend on your structure and syntax can differ depending on the database). This example is for PostGIS:
Alter table <table> add column {vectorcolumn} TSVECTOR Update <table> set {vectorcolumn} = to_tsvector ({sourcecolumn}) Create index {vectorcolumn}_gin on <table> using GIN({vectorcolumn})
When you replace the placeholders contained in {} including the {}, this code will add a vector column, populate and then index it.
For eg to run a search on a postcode column stored in a PostGIS database you would need to run the following SQL statements:
ALTER TABLE <table> ADD COLUMN postcodevector TSVECTOR UPDATE <table> SET postcodevector = to_tsvector (postcode) CREATE index postcodevector_gin ON <table> USING GIN(postcodevector)
To create an index on a column in another database just run the final SQL statement.