sf_store
This bundle contains factories for two kinds of stores:
- DocumentStore
- SuggestStore
The SuggestStore is required while typing a search term into a search box. It responds with a list of suggestions for this search term.
The DocumentStore is used for requesting all results matching a specific search expression.
Configuration
Defining the store instances
In the app.json
file you can configure any number of SuggestStore
and DocumentStore
instances.
Each SuggestStore
and DocumentStore
configuration must have the following properties:
Property Name | Type | Description |
---|---|---|
id |
String | An identifier for the store. The value must be unique among all stores registered in the app. |
target |
String | The URL of the search service followed by the smart.finder core name, e.g. https://demos.conterra.de/ct-finder-server-webapp-2.0.9/core0 |
Additionally, a SuggestStore
must also have a title
attribute.
Property Name | Type | Description |
---|---|---|
title |
String | The title of the store as displayed in the select box in OmniSearch. |
Optionally you can configure a query template for each DocumentStore
to define your own Solr query.
For information how to define templates see: smart.finder - Query templates
Property Name | Type | Description |
---|---|---|
queryTemplate |
String | A template that will be used to transform queries to the Solr backend. |
Example
Here is an example for a complete store configuration:
"sf_store": {
"SuggestStore": [
{
"id": "core0_suggest_store",
"title": "smart.finder Suchindex",
"target": "https://demos.conterra.de/ct-finder-server-webapp-1.6.0/core0"
},
{
"id": "isoCore_suggest_store",
"title": "smart.finder SDI Suchindex",
"target": "https://demos.conterra.de/ct-finder-server-webapp-1.6.0/iso"
}
],
"DocumentStore": [
{
"id": "core0_store",
"target": "https://demos.conterra.de/ct-finder-server-webapp-1.6.0/core0"
},
{
"id": "isoCore_store",
"target": "https://demos.conterra.de/ct-finder-server-webapp-1.6.0/iso"
}
]
}
How is a SuggestStore connected to a DocumentStore?
When a search term is typed into the search box, the SuggestStore is queried for suggestions. Once the user selects one of these suggestions, the corresponding DocumentStore is queried with that suggestion.
But how does smart.finder know the correct DocumentStore for a given SuggestStore? For this, the URLs of the stores are examined. The part after the last slash (/) character is the core name. SuggestStores and DocumentStores with equal core names belong together.
Configuring the attribute filter (also known as "facet search")
You can define the attributes that are displayed in the filter on the left hand side of the results page.
You can configure the attribute filter for each smart.finder core separately. In your app.json file look for the DocumentStore
instance that points to the desired smart.finder core. Then edit the facetFields
property and list the fields you wish to appear in the filter.
Property Name | Type | Description |
---|---|---|
facetFields |
Array<String> | A list of field names you wish to appear in the attribute filter. |
Example:
"sf_store": {
"SuggestStore": [
...
],
"DocumentStore": [
{
"id": "core0_store",
"target": "https://demos.conterra.de/ct-finder-server-webapp-1.6,
"facetFields": ["publisher","language","type","format", "accessRights"],
},
...
]
}
Configuring the spatial reference system for data with geometry
Usually each metadata record has a certain geometry. By default, it is assumed that these geometries use the spatial reference system with the ID EPSG:4326 (see https://epsg.io/4326). However, if your geometry records have coordinates in a different spatial reference system, you run into issues when performing spatial queries and displaying your metadata on a map.
In such cases, you need to tell the DocumentStore
component the correct spatial reference by specifying the spatial reference's EPSG code in the spatialReferenceWkidOfGeometriesInIndex
property. For example, if your geometry data is stored in the index in the coordinate system DHDN / 3-degree Gauss-Kruger zone 2, specify 31466
(see https://epsg.io/31466).
Property Name | Type | Default value | Description |
---|---|---|---|
spatialReferenceWkidOfGeometriesInIndex |
Number | 4326 | The EPSG code of the spatial reference system of the geometries in the index. |