| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
A simple example plugin demonstrating how to create custom script engines for Fess, the open-source enterprise search server.
A Fess script engine turns a template plus a parameter map into a value. Fess uses script engines wherever an administrator can enter a small script or expression — for example to compute a document boost, derive a field value during crawling, or run logic in a scheduled job. The built-in groovy engine evaluates full Groovy scripts; this example shows the minimal shape of a custom one.
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.
The plugin extends Fess's AbstractScriptEngine class and implements:
You can download the plugin JAR from Maven Central.
For detailed installation instructions, see the Fess Plugin Guide.
There is no extra configuration to "use" the engine — the plugin self-registers via fess_se++.xml when Fess starts. Once installed, the engine is available by its registered name, example, anywhere Fess lets you pick a script type, including:
In those places, select or enter example as the script type and provide a template such as Hello ${name}. Internally Fess resolves the engine through the factory:
ComponentUtil.getScriptEngineFactory().getScriptEngine("example").evaluate(template, paramMap);This example engine substitutes ${key} placeholders with values from the parameter map, which makes it a useful starting point for learning the API and for building richer engines.
git clone https://github.com/codelibs/fess-script-example.git
cd fess-script-example
mvn clean packagemvn testThe test suite includes focused test cases covering:
# Format code
mvn formatter:format
# Check license headers
mvn license:check
# Generate Javadoc
mvn javadoc:javadocsrc/
├── main/java/
│ └── org/codelibs/fess/script/example/
│ └── ExampleEngine.java # Script engine implementation (${key} substitution)
├── main/resources/
│ └── fess_se++.xml # DI fragment that registers the engine (additive merge)
└── test/
├── java/
│ └── org/codelibs/fess/script/example/
│ ├── ExampleEngineTest.java # Engine tests + factory lookup
│ └── UnitScriptTestCase.java # Minimal UTFlute test base for the plugin
└── resources/
└── test_app.xml # Test DI container (includes scriptEngineFactory)
This project serves as a template for creating custom script engines. To create your own:
We welcome contributions! Please feel free to submit issues, feature requests, or pull requests.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Developed by CodeLibs Project
| Back | FazBrowse Home | New Git URL |