Overview
Dict API is an API for managing Fess dictionaries. The root endpoint can retrieve the list of available dictionaries. Reading, creating, updating, and deleting individual dictionary items, as well as uploading and downloading dictionary files, are performed via the sub-endpoints for each dictionary type (synonym, kuromoji, mapping, protwords, stopwords, stemmeroverride).
Base URL
Endpoint List
Dictionary Root
| Method | Path | Description |
|---|---|---|
| GET | / | List dictionaries |
Endpoints per Dictionary Type
For {type}, specify one of synonym, kuromoji, mapping, protwords, stopwords, or stemmeroverride. These values match the value of the type field included in the dictionary list response. {dictId} is the ID of the dictionary obtained from the dictionary list.
| Method | Path | Description |
|---|---|---|
| GET | /{type}/settings/{dictId} | List dictionary items |
| GET | /{type}/setting/{dictId}/{id} | Get dictionary item |
| POST | /{type}/setting/{dictId} | Create dictionary item |
| PUT | /{type}/setting/{dictId} | Update dictionary item |
| DELETE | /{type}/setting/{dictId}/{id} | Delete dictionary item |
| PUT | /{type}/upload/{dictId} | Upload dictionary file |
| GET | /{type}/download/{dictId} | Download dictionary file |
List Dictionaries
Retrieve the list of available dictionary files.
Request
Response
Response Fields
| Field | Description |
|---|---|
settings[].id | Dictionary ID (used as {dictId} in individual dictionary operations) |
settings[].type | Dictionary type |
settings[].path | Path of the dictionary file |
settings[].timestamp | Update date/time of the dictionary file |
total | Total number of dictionary files |
List Dictionary Items
List the items in the specified dictionary.
Request
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
dictId | String | Yes | Dictionary ID (path parameter) |
size | Integer | No | Number of items per page (default: 25) |
page | Integer | No | Page number (starts at 1, default: 1) |
Response
The fields of each item in the settings array of the response differ by dictionary type (see “Item Fields per Dictionary Type” below).
The above is an example of the synonym dictionary.
Get Dictionary Item
Retrieve a specific item in the dictionary.
Request
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
dictId | String | Yes | Dictionary ID (path parameter) |
id | Long | Yes | Item ID (path parameter) |
Response
Create Dictionary Item
Create a new item in the dictionary.
Request
Request Body (synonym example)
Response
Update Dictionary Item
Update an existing item in the dictionary.
Request
Request Body (synonym example)
Response
Delete Dictionary Item
Delete an item in the dictionary.
Request
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
dictId | String | Yes | Dictionary ID (path parameter) |
id | Long | Yes | Item ID (path parameter) |
Response
Upload Dictionary File
Upload and replace the entire dictionary file.
Request
The name of the file field differs by dictionary type (see “Item Fields per Dictionary Type” below).
Response
Download Dictionary File
Download the dictionary file.
Request
The response is the binary of the dictionary file (application/octet-stream).
Item Fields per Dictionary Type
The fields of the request body and response for creating and updating dictionary items differ by dictionary type. id (item ID) and dictId (dictionary ID) are commonly included in the response.
| Type | Item Fields | Upload File Field |
|---|---|---|
synonym | inputs (required), outputs (required) | synonymFile |
kuromoji | token (required), segmentation (required), reading (required), pos (required) | kuromojiFile |
mapping | inputs (required), output | charMappingFile |
protwords | input (required) | protwordsFile |
stopwords | input (required) | stopwordsFile |
stemmeroverride | input (required), output (required) | stemmerOverrideFile |
Usage Examples
List Dictionaries
List Synonym Dictionary Items
Add an Item to the Synonym Dictionary
Upload a Synonym Dictionary File
Download a Synonym Dictionary File
Reference
Admin API Overview - Admin API Overview
Dictionary - Dictionary Management Guide