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 collection 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
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)
Usage
Once the plugin is enabled on a collection, the implemented plugin methods will be executed during the next collection update.
Examples
Logging
As the plugin will be run during a collection update, logging from above methods will appear in the collection’s indexer logs.