Overview
Fess allows you to implement custom logic using scripts in various scenarios. By utilizing scripts, you can flexibly control data processing during crawling, search result customization, and scheduled job execution.
Supported Scripting Languages
Fess supports the following scripting languages:
Note
Groovy is the most widely used, and the examples in this documentation are written in Groovy.
Use Cases for Scripts
Data Store Configuration
Data store connectors use scripts to map retrieved data to index fields.
Path Mapping
Scripts can be used for URL normalization and path conversion.
Scheduled Jobs
Scheduled jobs allow you to write custom processing logic in Groovy scripts.
Basic Syntax
Variable Access
String Operations
Conditional Branching
Date Operations
Available Objects
Main objects available within scripts:
| Object | Description |
|---|---|
data | Data retrieved from the data store |
container | DI container (access to components) |
systemHelper | System helper |
fessConfig | Fess configuration |
Security
Warning
Scripts have powerful capabilities, so only use them from trusted sources.
Scripts are executed on the server
Access to the file system and network is possible
Ensure only users with administrator privileges can edit scripts
Performance
Tips for optimizing script performance:
Avoid complex processing: Scripts are executed for each document
Minimize external resource access: Network calls cause delays
Use caching: Consider caching values that are used repeatedly
Debugging
Use log output to debug scripts:
Log level configuration:
app/WEB-INF/classes/log4j2.xml:
Reference Information
Groovy Scripting Guide - Groovy Scripting Guide
Data Store Crawling - Data Store Configuration Guide
Scheduler - Scheduler Configuration Guide