Services

A Fuse service is a process separate from the Fuse engine that processes existing or adds new documents to Fuse. These services can significantly enrich existing documents by adding useful data to drive facets with minimal effort.

../_images/services.png

Configuring a Service

Configuring of a service is primarily done through the Content Schema. When defining a type, just add the following key to the attributes defined. The example below will extract the keywords California, Idaho, Oregon, Nevada, and Washington from the attribute content in the field west_coast_states.

Services Available

filewatcher

This service watches a local directory and syncs the content with Fuse. When a file is added to the local directory being watched, this service does the following:

  1. Detects the new file added.
  2. Extract text from the file based on its filetype.
  3. Extract keywords defined. (See configuring extractions).
  4. Upload the extracted text and extractions to Fuse.

This service is enabled by default and is watching the /docs directory in the docker container it is running from.

Configuring Extractions

Keyword extractions are configured in the Content Schema as additional keys in the attributes object. You can think of them as automatically populated fields that take another field as an input.

List of Keywords

Keyword extractions can be defined as a list of keywords:

Separate File

The can also be included in another file in the configuration package separated by new lines:

Where states.txt is:

California
Idaho
Oregon
Nevada
Washington
List of Regular Expressions

They can also be defined as a list of regular expressions:

Extractions Object

Below are a full list of options for configuring extractions.

Extractions
keywords array optional List of keywords to extract from Extractions.input.
|
Regex
| |
regex str required Regular expression to look for.
| |
| |
dotall bool optional
| |
ignorecase bool optional Ignore case when matching.
| |
| |

Services API

Get all Services

GET
/api/services

Get the status of all services.

ServiceStatusList
items array optional Array of ServiceStatus objects.

Get a Single Service

GET
/api/services/{string:service}

Get the status of a single service. Services are returned in the following form:

ServiceStatus
id str always Unique name for this service.
status str always One of active or stopped.
average_task_duration float always Average task duration of this service.
queue_size int always Number of tasks in task queue.

Enable a Service

POST
/api/services/{string:service}/enable

Enable a service.

Disable a Service

POST
/api/services/{string:service}/disable

Disable a service.