A simple example plugin demonstrating how to create custom script engines for Fess, the open-source enterprise search server.
This plugin provides a minimal implementation of a custom script engine for Fess. The ExampleEngine
serves as a template and starting point for developers who want to create their own script engines with custom template processing logic.
- Simple Implementation: Demonstrates the basic structure of a Fess script engine
- Template Pass-through: Returns template strings unchanged (useful for testing and learning)
- Full Integration: Properly integrated with Fess's dependency injection container
- Comprehensive Tests: Includes extensive test cases covering edge cases and various scenarios
The plugin extends Fess's AbstractScriptEngine
class and implements:
- Template Evaluation: Process template strings with parameter maps
- Engine Identification: Provides a unique name ("example") for the script engine
- DI Integration: Configured via LastaDi container for seamless Fess integration
- Fess 15.0.0 or later
- Java 21 or later
You can download the plugin JAR from Maven Central.
- Download the latest
fess-script-example-{version}.jar
from the releases - Copy the JAR file to your Fess plugin directory (
$FESS_HOME/app/WEB-INF/plugin/
) - Restart Fess server
- The "example" script engine will be available for use
For detailed installation instructions, see the Fess Plugin Guide.
Once installed, you can use the "example" script engine in your Fess configuration:
<component name="exampleScriptEngine" class="org.codelibs.fess.script.example.ExampleEngine"/>
The engine will process templates by returning them unchanged, making it useful for:
- Testing script engine integration
- Learning how to implement custom script engines
- As a starting point for more complex implementations
git clone https://github.com/codelibs/fess-script-example.git
cd fess-script-example
mvn clean package
mvn test
The test suite includes 19 comprehensive test cases covering:
- Basic functionality
- Edge cases (null/empty inputs)
- Various data types and special characters
- Multi-line templates and large content
- Instance independence and data integrity
# Format code
mvn formatter:format
# Check license headers
mvn license:check
# Generate Javadoc
mvn javadoc:javadoc
src/
├── main/java/
│ └── org/codelibs/fess/script/example/
│ └── ExampleEngine.java # Main script engine implementation
├── main/resources/
│ └── fess_se++.xml # DI container configuration
└── test/java/
└── org/codelibs/fess/script/example/
└── ExampleEngineTest.java # Comprehensive test suite
This project serves as a template for creating custom script engines. To create your own:
- Fork this repository
- Rename the
ExampleEngine
class - Implement your custom template processing logic in the
evaluate
method - Update the
getName
method to return your engine's unique identifier - Update the DI configuration in
fess_se++.xml
- Add appropriate tests
- Fess Framework: Core search server functionality (provided scope)
- LastaFlute: Web application framework with DI container
- DBFlute: Database access framework
- OpenSearch: Search engine integration (provided scope)
- UTFlute: Testing framework for LastaFlute applications
We welcome contributions! Please feel free to submit issues, feature requests, or pull requests.
- Follow the existing code style and formatting
- Add comprehensive tests for new functionality
- Update documentation as needed
- Ensure all tests pass before submitting PRs
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
- Documentation: Fess Official Documentation
- Issues: GitHub Issues
- Community: Fess Community Forum
- Fess - The main Fess search server
- Fess Plugins - Other Fess plugins
Developed by CodeLibs Project