Overview
The JSON Connector provides functionality to retrieve data from local JSON files and JSONL files and register them in the Fess index.
This feature requires the fess-ds-json plugin.
Prerequisites
Plugin installation is required
Access to JSON files is required
Understanding of JSON structure is necessary
Plugin Installation
Method 1: Place JAR file directly
Method 2: Install from admin console
Open “System” -> “Plugins”
Upload the JAR file
Restart Fess
Configuration
Configure in the admin console under “Crawler” -> “Data Store” -> “Create New”.
Basic Settings
| Item | Example |
|---|---|
| Name | Products JSON |
| Handler Name | JsonDataStore |
| Enabled | On |
Parameter Configuration
Local file:
Multiple files:
Directory:
Parameter List
Warning
Either files or directories must be specified. If neither is specified, a DataStoreException will be thrown. If both are specified, files takes precedence and directories is ignored.
Note
This connector only supports JSON files on the local filesystem. HTTP access and API authentication are not supported.
Script Configuration
Simple JSON object:
Nested JSON object:
Array element processing:
Available Fields
data.<field_name>- JSON object fielddata.<parent>.<child>- Nested objectdata.<array>[<index>]- Array elementdata.<array>.<method>- Array methods (join, length, etc.)
JSON Format Details
JSON File Format
The JSON Connector reads files in JSONL (JSON Lines) format. This format has one JSON object per line.
Note
JSON array format files ( [{...}, {...}] ) cannot be read directly. Please convert them to JSONL format.
JSONL format file:
Usage Examples
Product Catalog
Parameters:
Script:
Merging Multiple JSON Files
Parameters:
Script:
Troubleshooting
File Not Found
Symptom: FileNotFoundException
Checklist:
Verify the file path is correct
Verify the file exists
Verify read permissions on the file
JSON Parse Error
Symptom: JsonParseException or Unexpected character
Checklist:
Verify the JSON file is in correct format:
Verify the character encoding is correct
Check for invalid characters or line breaks
Check for comments (comments are not allowed in standard JSON)
No Data Retrieved
Symptom: Crawl succeeds but item count is 0
Checklist:
Verify the JSON structure
Verify the script configuration is correct
Verify field names are correct (including case sensitivity)
Check log messages for errors
Large JSON Files
Symptom: Out of memory or timeout
Solution:
Split the JSON file into multiple files
Increase the Fess heap size
Advanced Script Examples
Conditional Processing
Each field is evaluated as an independent expression. Use ternary operators for conditional values:
Joining Arrays
Setting Default Values
Date Formatting
Numeric Processing
Reference
Data Store Connector Overview - Data Store Connector Overview
CSV Connector - CSV Connector
Database Connector - Database Connector
Data Store Crawling - Data Store Configuration Guide