Configuration

Config files

The following configuration files are processed by smart.finder:

  1. WEB-INF/classes/default-application.properties (DO NOT EDIT)
    This file contains all configuration options of smart.finder with their default values.

  2. WEB-INF/classes/custom-application.properties
    If it is necessary to change the working directory (`data.directory.location'), the change must be made in this file. All further adjustments are made in the following file.

  3. [data.directory.location]/application.properties
    Editing this file is the recommended way to make configuration changes. The working directory (data.directory.location) of smart.finder is the directory ${user.home}/.smartfinder in the standard installation. The file is not created automatically, so you can use the file 'WEB-INF/classes/application.properties' as a template. It is recommended to leave only those settings in the file that have been changed.

The format of the configuration files must correspond to the Java 'properties' file format, which is described at https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html.

Sample .properties
# The files must be UTF-8 encoded, otherwise umlauts can cause errors!
# The safest way is to encode umlauts in Unicode syntax e.g: ä = \u00E4 (vgl. http://0xcc.net/jsescape/)

# Comments are preceded by a hash

# Common syntax:
key = value

# A value can reference another key
key1 = http://${key.with.server}/test
After changing one of the configuration files a restart of the web application is required (you can also restart the complete Tomcat server)

Client Properties

This file is located in the directory: [TOMCAT]\webapps\ct-finder-client-webapp-[VERSION]\WEB-INF\classes\. Within this file the following parameters can be adjusted:

client.config.defaultLocale

smart.finder supports the languages German and English in the user interface by default. The browser language setting is recognized and smart.finder is started in the corresponding language. If the language in the browser is neither German nor English, the value specified in this setting is used.

proxy.allowedServerUrls

smart.finder provides an integrated Proxy Servlet. This is required because direct access to certain resources that are only accessible under another domain is prohibited due to security restrictions within JavaScript. This parameter contains a list of URLs that the Proxy Servlet may access.

A ";" must be placed after each URL. Each line, except the last, ends with a "\".
finder.service.url

This is the context name of the smart.finder server (default: /ct-finder-server-webapp-[VERSION]). If the name was changed during the installation of the smart.finder Server (see: Installation of smart.finder), the current name must be entered here.

Server Properties

The file for changing the server settings can be found here: [TOMCAT]\webapps\ct-finder-server-webapp-[VERSION]\WEB-INF\classes\. Within this file the following parameters can be adjusted:

security.mode (INTEGRATED | NONE | ONYL_AUTHN)

Access to the administrative areas of the smart.finder can be protected if required. To do this, the value of this parameter must be set to 'INTEGRATED' (otherwise: 'NONE'). If 'INTEGRATED' was selected, the mode can be specified in more detail using the following parameter set:

security.user.admin.name

The user name in plain text.

security.user.admin.pw

Das Passwort des Benutzers. Diese muss entsprechend der gewählten Kodierung beschrieben sein.

security.user.pwenc (plain|MD5|SHA-1)

The encoding of the password. This can be "plain" (no coding) or by means of MD5 (Message-Digest Algorithm 5) or SHA-1 (secure hash algorithm). For the latter variants, there are various web services that support the generation of encrypted passwords, e.g. http://www.sha1generator.de/ or http://www.md5generator.de/.

security.user.use_mapped_pass (true|false)

If a password encoding other than "plain" is selected, the value of this parameter must be 'true', otherwise 'false'.

security.ssl.trustAny

The switch enables support for self-signed certificates for HTTPS connections. By default, the feature is disabled (`false'). A change to the value 'trust' enables the function.

solr.indexing.delay

Time in milliseconds after indexing starts.

solr.indexing.period

Time period in milliseconds after the system checks whether the created documents need to be indexed.

solr.solr.home

Directory path to solr.home (absolute or relative). You can also use placeholders that are resolved by the Web Container, e.g. ${catalina.base}/webapps/ct-finder-server-webapp-[VERSION]/WEB-INF/solr.home.

mailing.host

The host name on which an SMTP server is available for sending e-mails.

mailing.port

The SMTP port on the SMTP host computer.

mailing.username

User name for the SMTP server (if required).

mailing.password

Password for the SMTP server (if required).

mailing.senderaddress

Reply address for e-mail dispatch.

mailing.locale (de|en)

Language setting for sending e-mails.

indexing.execution.restartFailedJobs

If 'true', jobs with the status "failed" and configured scheduling will continue to be repeated and executed again. Otherwise, jobs must be restarted manually. The default value is true.

indexing.execution.maxThreads

Specifies the maximum number of jobs that can be executed in parallel. All other jobs are appended to a queue. Default value is '1', which is equivalent to the number of existing CPU cores - 1.

indexing.thumbnails.enabled

Enables the harmonization of thumbnails with regard to their size (default: false)

indexing.thumbnails.height

If indexing.thumbnails.enabled=true this value defines the target height of the thumbnails.

indexing.thumbnails.width

If indexing.thumbnails.enabled=true this value defines the target width of the thumbnails.

indexing.thumbnails.resizeMode

Scaling mode that determines how the proportions of the thumbnail are calculated. Must be one of the following modes: AUTOMATIC, FIT_EXACT, FIT_TO_WIDTH or FIT_TO_HEIGHT.

indexing.crawler.politenessInMs

The delay in milliseconds between two consecutive requests. Set this parameter > 0 to avoid a denial of service attack behavior.

indexing.dih.maxRetries

The number of retries to see if the server process has finished

indexing.dih.retryDelayInSeconds

The seconds to wait for the next retry

indexing.dih.requestHandlerContext

The context name of the data import handler. If you change this value, it must also be changed in the configuration file (see: solrconfig.xml) of the affected cores

indexing.csw.pageSize

Property that defines how many documents are requested simultaneously when indexing a CSW service

indexing.ags.content.pageSize

Property that defines how many features are requested simultaneously when indexing an AGS service

indexing.ags.content.maxRetryCount

Number of retries when a request against an AGS service fails

indexing.ags.content.retryDelayInSeconds

Delay in seconds between two consecutive attempts against an AGS service

Change the names of the Web Context

smart.finder is delivered with two standard Web context names:

  • ct-finder-client-webapp-[VERSION]

  • ct-finder-server-webapp-[VERSION]

To install the Web Applications under different names in the Tomcat container, you can modify them according to the Servlet API specifications. The following parameters must also be adjusted in the Web applications themselves:

In the file

[TOMCAT_HOME]\webapps\ct-finder-server-webapp-[VERSION]\META-INF\context.xml

the value of the environment variable `solr/home' must be adjusted.

In the file application.properties for the ct-finder-client-webapp the value of the property finder.service.url must be adjusted accordingly.

Changing the location of the index

In the standard system, the index of smart.finder is stored under the following path:

[TOMCAT_HOME]\webapps\ct-finder-server-webapp-[VERSION]\WEB-INF\solr.home

You can change the location in the following file:

[TOMCAT_HOME]\webapps\ct-finder-server-webapp-[VERSION]\META-INF\context.xml

For this you have to adjust the value of the environment variable `solr/home' accordingly.

Sort search results

In the standard configuration, the result of a search query to the index is sorted according to the hit probability (score). In contrast, if results are to be sorted alphabetically according to a field (e.g. "Title"), the schema configuration of this field must be unique. This means that fields used by analyzers (including all fields of type "text") can only be used for sorting search results if the analyzer generates exactly one single expression.

Further restrictions for sorting can be found in the Solr documentation.

To be able to sort on such fields nevertheless, these fields must be copied into a new field of a different type in the schema using copyField. The following is an example for the field 'name':

Adapted schema.xml
<fields>
    [...]
    <field name="name" type="text" indexed="true" stored="true" required="false" multiValued="false"/>
    <copyField source="name" dest="name_string"/>
    <field name="name_string" type="string" indexed="true" stored="true" required="false" multiValued="false"/>
    [...]
</fields>

Save the file. Restart the smart.finder server or Apache Tomcat for the changes to take effect.

Configuration of synonyms of the facet values

Sometimes the terms used in the database are not consistent for one thing. For example, the values 'shape' and 'shapefile' both refer to the same format. This means they are synonyms. In such a case, these values should be combined. For example, the values of the facet 'format' could always be displayed as 'SHP' in the user interface.

To configure this, 3 steps are necessary:

Step 1: Mapping values to synonyms

Synonyms are entered in a configuration file, which can be found under /ct-finder-server-webapp-[VERSION]/WEB-INF/solr.home/core0/conf/lang/synonyms.txt.

For the above example, the following line would need to be added: shape, Shapefile ⇒ SHP.

The values before the arrow are also stored in the index. You can still search for 'shape' and 'Shapefile', but also for 'SHP'. In the attribute filter 'SHP' is always displayed. A filter on the value 'SHP' then includes all its synonyms.

Step 2: Synonym index linking

Now the synonyms must be linked to the field in the index. To do this, open the file /ct-finder-server-webapp-[VERSION]/WEB-INF/solr.home/core0/conf/schema.xml and find the field for whose values the synonyms are to be defined.

In our example this is the field 'format':

<field name="format" type="string" indexed="true" stored="true" required="false" multiValued="true"/>

Directly below it, a new field with type 'text_synonym' is now created, for example with the name 'format_facet' and the following attributes:

<field name="format_facet" type="text_synonym" indexed="true" stored="true" required="false" multiValued="true"/>

If documents have a value for the field 'format' when indexed, this value is also copied to the field 'format_facet'. This field can be used as a facet and must then also be configured in the client configuration 'facetFields'.

Add a new core

Starting with version 2.0.0 it is possible to implement additional cores. A Solr core consisting of a set of configuration files, Lucene index files and the transaction log of Solr. smart.finder is delivered with 3 cores:

  • indexingmanagement: is used for internal purposes only, e.g. management of the indexing job

  • core0: the standard core with a ready-made configuration that can be used for a variety of use cases.

  • smartsearch: this core can be used for the map.apps extension Smart Search Extension

All cores must be stored in the sor.home directory. The minimal structure is as follows:

/<core name>
    core.properties
    /conf
        /lang
            ...
        schema.xml
        solrconfig.xml
        tika-config.xml

To create a new core there are a number of possibilities:

  1. by copying and adapting an existing core, e.g. core0

  2. by using the Apache Solr CoreAdmin API

  3. using the Apache Solr Admin UI

When creating a new core, it is important to make sure that mandatory fields are defined in the schema in any case. These are:

<field name="id" type="string" indexed="true" stored="true"  multiValued="false" required="true"/>
<field name="timestamp" type="date" indexed="true" stored="true"  multiValued="false" default="NOW"/>
<field name="_version_" type="long" indexed="true" stored="true"/>
<field name="relatedIndexJobId" type="string" indexed="true" stored="true"  multiValued="false" required="false"/>

If a new Core has been created, it can be selected in the Job Manager for each job after restarting the smart.finder Server. All documents of the job are then indexed in this core.