Plugin indexing interface

Introduction

The plugin indexing interface provides access to read and set a range of configuration options that apply during indexing. This includes:

  • metadata mappings

  • xml index settings

  • external metadata

  • gscopes

  • kill configuration

  • auto-completion CSV

Interface methods

To interact with indexing, you will need to implement the IndexingConfigProvider interface.

The IndexingConfigProvider interface provides several methods that can be implemented independently.

Each of these methods will be given a IndexConfigProviderContext which provides the configuration for the data source being updated.

Metadata class mappings

Metadata mappings can be defined using:

void metadataMappings​(IndexConfigProviderContext context, MetadataMappingConsumer consumer)

See: Javadoc: metadataMappings for an example on how to use the consumer to provide a new metadata mapping. This page also has an explanation on how conflicts are resolved.

External metadata

External metadata can be set using:

void externalMetadata​(IndexConfigProviderContext context, ExternalMetadataConsumer consumer)

See: Javadoc: externalMetadata for an example on how to use the consumer to provide new external metadata mappings. This page also has an explanation on how conflicts are resolved.

Gscopes

Gscopes can be set by implementing one of two methods:

void supplyGscopesByQuery​(IndexConfigProviderContext context, GscopeByQueryConsumer consumer)
void supplyGscopesByRegex​(IndexConfigProviderContext context, GscopeByRegexConsumer consumer)

Kill documents

Configuration for killing documents by partial or exact matches can be supplied by implementing:

void killByExactMatch​(IndexConfigProviderContext context, KillByExactMatchConsumer consumer)
void killByPartialMatch​(IndexConfigProviderContext context, KillByPartialMatchConsumer consumer)

XML indexing configuration

Configuration for XML indexing can be supplied by implementing:

 XmlIndexingConfig xmlIndexingConfig​(IndexConfigProviderContext context)

Auto-completion CSV

Auto-completion CSV can be set per-results page, with one for each results [age] that this plugin is enabled on.

Usage

Once the plugin is enabled on a results page, the implemented plugin methods will be executed during the next data source update.

Examples

The following plugins are examples which demonstrate usage of the above interface.

Additional metadata

Demonstrates using a plugin to supply additional metadata mappings.

Logging

As the plugin will be run during a data source update, logging from above methods will appear in the data source’s indexer logs.