SQL sources

Having set up an SQL connection, you can define a source. The name implies that this will be a source for Portrait and your future sections. Technically speaking, sources are SQL queries. The results of these queries will be stored as lists in Portrait.

Add the following to the source section inside the application.yml file:

sources: source: - id: 'Customer' conn: 'NAVDEMO' sourceType: 'sql' runInterval: 3600 key: No_ keyName: Name excludeKeysFromSuggestions: [] sourceSpecific: sqlQuery: "SELECT * FROM [CRONUS AG$Customer] CUS"

 

The name of the source will be Customer. The name will be later on used inside the section. In this example, the connection NAVDEMO is used and therefore must be defined firsthand. The sourceType will be in case of ELO always be sql. Thus, sourceSpecific config is required. Each SQL source needs a sqlQuery.

Settings

Name

 

Name

 

id String

Name of the source

conn String

Used connection.
Refer to SQL connections

sourceType String

In case of SQL: sql

keyName String

Name of the indexed object.

key String

Unique Id of the indexed object.

The key must be unique to this document in Portrait. Avoid key conflicts at all costs.

For instance, a simple unique id (e.g. 1, 2, 3…) in the source “Customer” will clash with the same unique id (1,2,3,…) in source “Supplier”.

runInterval Integer

reindex interval of the source in seconds

runDelay Integer OPTIONAL

delay before the first reindex run in seconds.

runAt String

instead of using an interval, you can define a specific time when the reindex will be triggered. Example:

runtAt: 07:00

runAt cannot be combined with runInterval

excludeKeysFromSuggestions List<string>

This list excludes the Keys from being added to the suggesters. Suggesters are used inside the search as “Completion Suggester” and “Did you Mean”.

icon String

See Entry Icons

sourceSpecific.sqlQuery String

The used sql query for retrieving the data. We recommend that you go invest some time for your query and define the columns (avoid *) and test the performance of your query beforehand.