Admin Guide

Configuration

Synapse-Search requires the following Power-Ups to be installed:

Name   : synapse-fileparser
Version: >=4.2.1,<5.0.0
Desc   : Synapse-FileParser is required in order to index file text.

Permissions

Package (synapse-search) defines the following permissions:
power-ups.search.admin           : Allows a user to modify indexes in addition to searching Synapse-Search. ( default: false )
power-ups.search.user            : Allows a user to search Synapse-Search. ( default: false )

You may add rules to users/roles directly from storm:

> auth.user.addrule visi power-ups.search.user
Added rule power-ups.search.user to user visi.

or:

> auth.role.addrule ninjas power-ups.search.user
Added rule power-ups.search.user to role ninjas.

Managing Indexes

An index is added by specifying a fully qualified property name, which Synapse Search will then retrieve from the Cortex for all layers. The service will index all existing values, and honor updates going forward, including layer changes.

Currently only properties of type str can be indexed.

Index a secondary property

> search.index.add media:news:title
Added index for media:news:title

Index a primary property

> search.index.add ps:name
Added index for ps:name

Index file text

Synapse Search also supports indexing parsed text from a file provided by FileParser, by passing file:bytes nodes to the search.files.add command.

> file:bytes#myfile | search.files.add

The service creates a special property, file:bytes:_text, which can be used in the search and search.index.del commands.

Delete an index

This will drop all of the data associated with the fully qualified property, and remove it from live indexing going forward.

> search.index.del ps:name
Deleting index for ps:name will begin shortly

Display the indexing status

> search.status
Indexing at 11, Cortex at 11

Display the status for individual properties.

> search.status --debug
Indexing at 11, Cortex at 11

Prop                                               |     Status |       Reason |    Count
-----------------------------------------------------------------------------------------
media:news:title                                   |       live |   user_added |        1
ps:name                                            |    deleted | user_deleted |        0

Using Custom Token Roots

Custom token roots can be used to specify an association that applies to the indexed values.

For example, to index colour as color:

> $retn=$lib.import(search).addToknRoot("colour", "color") $lib.print($retn)
[True, None]

This change is only applied to indexed values going forward, and therefore to pick up the changes the search.index.reload command should be used.

> search color
> search.index.reload
Reindexing will begin shortly
> search color
media:news=0e21741c5bedec378e079bb04d33a05e
        .created = 2024/04/16 15:13:04.908
        :title = colour news

Storm APIs also exist to get, list, and delete, the custom token roots.

Node Actions

Synapse Search does not currently provide any node actions in Optic.