Skip to content

Latest commit

 

History

History
56 lines (45 loc) · 2.75 KB

File metadata and controls

56 lines (45 loc) · 2.75 KB

Index Stage SDK - examples

This folder contains examples of indexing stages implemented with the SDK.

Creating custom plugin

This documentation and examples use Gradle for building index stage plugins. If required alternative build tools can be used for building plugins.

Plugin Gradle Project Layout

See Gradle quickstart for Java Projects.

The minimal project layout is as follows:

my-index-stage
├── build.gradle
├── gradle.properties
├── settings.gradle
└── src
    └── main
        └── java
            └── MyIndexStageConfig.java
            └── MyIndexStage.java

build.gradle

This is a typical Gradle build file. It should at least include com.lucidworks-plugins.index-stage-sdk:index-stage-plugin-sdk library and allow to create a plugin zip file.

You can check a complete example here.

src/main/java

This is where Java code lives by default. This location can be changed, but in this documentation we use the Gradle default.

Minimal plugin project must contain a stage class and related configuration. More details about stage and configuration classes can be found at index-stage-plugin-sdk documentation.

Unit tests

Index Stage SDK provides a number of helper classes to simplify unit testing of index stage plugins. To take advantage of the testing framework, plugin project needs to add the following test dependency:

testImplementation "com.lucidworks-plugins.index-stage-sdk:index-stage-sdk-test:1.+"

Once the dependency is added, unit test classes can extend com.lucidworks.indexing.sdk.test.IndexStageTestBase and use provided convenience methods to create test documents, index stage configurations and index stage instances. Unit test examples can be found here.

Plugin

Plugin is a zip file that contains:

  • Compiled plugin implementation classes packed into jar
  • Additional library dependencies jar files used by the plugin
  • Plugin manifest (META-INF/MANIFEST.MF). It should contain at least following entries:
    • Manifest-Version: 1.0
    • Plugin-Id: Id to identify plugin in Fusion's Blob Store
    • Plugin-SDK-Version: Must be compatible with SDK version used by your version of Fusion
    • Plugin-Base-Package: Name of the package to scan for stage classes (must be annotated with @Stage)
    • Plugin-Version: Your plugin version

In the provided examples it is generated by assemblePlugin gradle task.