If you use open source clients to use search indexes, you must synchronize data from wide tables to index tables. To synchronize data, create column mappings between wide tables and index tables. This topic describes the parameters of column mappings.
Configuration example
Column mappings between a wide table and an index table are stored in JSON files. In the following example, data is synchronized from the wide table
testTable
to the index table democollection
. The f:name
column in the wide table is mapped to the f_name_s
column in the index table. The f:age
column in the wide table is mapped to the f_age_i
column in the index table. {
"sourceNamespace": "default",
"sourceTable": "testTable",
"targetIndexName": "democollection",
"indexType": "SOLR",
"rowkeyFormatterType": "STRING",
"fields": [
{
"source": "f:name",
"targetField": "name_s",
"type": "STRING"
},
{
"source": "f:age",
"targetField": "age_i",
"type": "INT"
}
]
}
Parameters
The following table describes the parameters of column mappings between the wide table and the index table.
Parameter | Description |
---|---|
sourceNamespace | The namespace name of the wide table. If the wide table does not have a namespace, the default namespace name is default. |
sourceTable | The name of the wide table. This parameter is required. |
targetIndexName | The index table name of the search engine LindormSearch. This parameter is required. |
indexType | The default value is SOLR. |
rowkeyFormatterType | Specifies the method that you want to use to map the primary key of the wide table to the ID of the primary key of the index table. The data type of the primary key of the index table is STRING. The following two methods are supported:
|
fields | Specifies one or more columns that you want to map and the types of the columns. The parameter value consists of the following three parameters. Separate multiple columns with commas (,).
|
targetField parameter
The targetField parameter specifies the column in the index table to which you want to map the column in the wide table. We recommend that you use the dynamic column feature provided by LindormSearch. LindormSearch automatically identifies the data type of the dynamic column by using the suffix of the dynamic column name. The format of the dynamic column name is
Column name:Data type of the column
. In the following example, the column name is name. The following table describes the data types that are supported by dynamic columns.Data type | Example value of the targetField parameter |
---|---|
INT | name_i |
LONG | name_l |
STRING | name_s |
STRING (data type of Chinese character strings that are tokenized) | name_ik |
BOOLEAN | name_b |
FLOAT | name_f |
DOUBLE | name_d |