You should have completed the work on switching from the MIT version to PRO, and also have the search database installed and running.
Fill in h_host
— http://localhost:7700
(you can right-click and select Default
).
If the host is on a remote server, the address of the remote server should be entered.
In h_key
, enter the key created during the installation stage, which is used to run the search database.
Look for the key in the meili_masterkey
file in the user's home directory totum
.
In index_name
, enter the schema in the search database — a good practice is to make it analogous to the Totum schema.
The schema is added to the search database at the moment the value is saved in the field — try to do this only once.
You can check the addition of the schema by clicking on Connect code
.
Search limit
is set to 20 by default. If you need to display a different maximum number of search options, enter the number.
We do not recommend setting a large number, as they will not fit on the screen anyway.
To set search settings, fill in settings
with the following parameters (this can be done by right-clicking on the field):
{
"displayedAttributes": [
"pk",
"index",
"catalog",
"title",
"text"
],
"searchableAttributes": [
"title",
"index"
],
"attributesForFaceting": [
"catalog",
"table"
]
}
Show settings
— shows the current search index (schema) settings.
Index it
— allows you to manually send rows to the search index by specifying id_table
+ /
+ id-rows
separated by commas.
If the rows were not in the index, they will be added.
If they were present, they will be updated.
The table must be added to the search tables and have a technical field
ttm_search
in the row part with the correct data format!
Delete from index
— allows you to manually delete rows from the index similarly to Index it
.
If you pass
table_id/*ALL*
, the search index for the entire table will be deleted.
Search
— search, the result of which is shown in json
.
The field
h_get_updates
is responsible for showing the search button in the interface. It is calculated by code based onh_host
,h_key
,h_index_name
,h_settings
, but you can set the value manually. For example, disable it until the table settings are entered.
Create a field of type data with name
= ttm_search
(mandatory!) in the target table. The search will be updated when this field is added (row), changed, and deleted (row). The content of this field is passed to the search database, which should match the format:
{
"index": "data for search",
"title": "title for this index",
"catalog": "catalog name from ttm__search_catalog"
}
For example:
= : rowCreate(field: "index" = str`#field_1 ++ #field_3`; field: "title" = #field_3; field: "catalog" = "video")
The catalog parameter is passed the name
of the catalog, which needs to be created in the ttm__search_catalog
table.
For a simple table, do not forget to recalculate the rows so that the data in ttm_search
is updated, and then check the data structure in a couple of rows.
After this, you need to add the table to the row part in ttm__search_settings
and fill in the code
and buttons
parameters.
code
— the action code that will be executed when clicking on the search result tile. It is executed from the row of the table containing the search result and receives the corresponding environment data.
buttons
— extends the possible actions by adding buttons to the search result tile.
To index (add to the search database) the data of the added table, click Index table
.