FieldIndexer migration details
Overview
If your app uses a FieldIndexer
via the customfield-searcher
element, you will need to update its configuration to match the new search API. This will help prepare your app for future search tool updates that aren’t reliant on Lucene. For a refresher on customfield-searcher
, visit the custom field searcher configuration guide.
To help you update your app, this page highlights the key modifications to indexers in the search API.
See the custom field sorting guide and the Search API upgrade guide for more information.
Indexers
Indexers implemented using the Search API are platform agnostic. To support multiple platforms, the following field definition restrictions exist:
- Fields must be pre-defined and registered as part of the index schema.
- Field names must be unique.
As a result, starting from Jira Data Center 10.4, com.atlassian.jira.issue.index.indexers.FieldIndexer
is deprecated in favor of com.atlassian.jira.search.issue.index.indexers.FieldIndexer
. The corresponding method mappings are provided in the table below for clear reference and implementation guidance.
Legacy Lucene @com.atlassian.jira.issue.index.indexers.FieldIndexer | Search API
| Notes |
|
| Returns the id of the Jira field that this indexer is indexing. This must be unique for each If the Indexer does not represent a System or Custom field in Jira, this must still return a unique string that describes the indexer. |
|
| Defines the fields on the index schema to configure how those fields will be stored and indexed on Lucene (and future search platforms). |
|
| |
|
| |
|
| |
|
|
To create a customized field indexer, make sure you implement the new FieldIndexer
interface or extend one of its base classes. Also ensure that all fields have unique names and field IDs.
- Define a field (in this example, we’ve used 'currency').
- Add this field to the index schema.
- Index the field.
Example 1: How to implement a simple FieldIndexer
This example creates a simple field that will always be visible and cannot be hidden. For example, in Jira, this would apply the the issue key or summary.
Legacy Lucene | Search API |
---|---|
|
|
Example 2: How to implement a FieldIndexer for a field that might be hidden
This example creates a field that might be visible or hidden depending on a condition. For example, in Jira, this applies to the issue description or assignee.
Legacy Lucene | Search API |
---|---|
|
|