Search API upgrade guide

はじめに

To provide you with more agnostic options for search tooling, we’re adding an abstraction layer to Jira’s search functionality. This change is key to enable future OpenSearch support, and is the start of our plans to remove Lucene from public APIs. Search and indexing performance will remain consistent with the existing Lucene implementation, ensuring a smooth transition.

This page documents Lucene-specific API and components that have been deprecated in favor of the platform-agnostic search API. We’ll add further information as the feature progresses.

FieldIndexer の移行詳細ページと https://developer.atlassian.com/server/jira/platform/custom-field/#custom-field-sorting で詳細を確認することもできます。

Migrating deprecated code to Search API

Due to the length of some of the strings in the table below, you might not see the full table width. To see more to the right or left, hover your mouse over the table before using it to scroll.

Module

廃止

手順

jira-api

com.atlassian.jira.index.EntitySearchExtractor and its subtypes:

  1. com.atlassian.jira.index.ChangeHistorySearchExtractor

  2. com.atlassian.jira.index.CommentSearchExtractor

  3. com.atlassian.jira.index.IssueSearchExtractor

Use com.atlassian.jira.search.entity.EntityIndexExtractor and its subtypes instead:

  1. com.atlassian.jira.search.entity.ChangeHistoryIndexExtractor

  2. com.atlassian.jira.search.entity.CommentIndexExtractor

  3. com.atlassian.jira.search.entity.IssueIndexExtractor

  4. com.atlassian.jira.search.entity.WorkLogIndexExtractor

jira-api

com.atlassian.jira.jql.query.ClauseQueryFactory and related interfaces:

  1. com.atlassian.jira.jql.query.QueryFactoryResult

  2. com.atlassian.jira.jql.query.OperatorSpecificQueryFactory

Use com.atlassian.jira.search.jql.ClauseQueryMapper instead, and the corresponding interfaces:

  1. com.atlassian.jira.search.jql.QueryFactoryResult

  2. com.atlassian.jira.search.jql.OperatorSpecificQueryFactory

jira-api

com.atlassian.jira.issue.search.LuceneFieldSorter.

Also deprecated, related searcher SPIs:

  1. com.atlassian.jira.issue.customfields.MultiSortableCustomFieldSearcher

  2. com.atlassian.jira.issue.customfields.SortableCustomFieldSearcher

  3. com.atlassian.jira.issue.customfields.NaturallyOrderedCustomFieldSearcher#getSortFieldType()

The deprecated class is used for two use cases: sorting, and loading field values from the index. Depending on the use case, replace LuceneFieldSorter with one of the following:

  • com.atlassian.jira.search.FieldSort

  • com.atlassian.jira.search.FieldValueLoader.

Migrate related searcher SPIs to the corresponding replacements:

  1. com.atlassian.jira.issue.customfields.FieldSortsCustomFieldSearcher

  2. com.atlassian.jira.issue.customfields.ValueLoaderCustomFieldSearcher

Remove implementations of com.atlassian.jira.issue.customfields.NaturallyOrderedCustomFieldSearcher#getSortFieldType(), i.e. revert to default.

Lucene

  • org.apache.lucene.search.SortField

  • org.apache.lucene.search.FieldComparatorSource

代わりに com.atlassian.jira.search.FieldSort を使用します。

Use one of the subtypes that corresponds with the legacy FieldComparatorSource:

  1. NaturalFieldSort: replaces StringSortComparatorSource and LongSortComparatorSource

  2. ValueLoaderFieldSort: replaces MappedSortComparator

  3. ScoreComputedFieldSort: replaces UserHistoryFieldComparatorSource

jira-api

com.atlassian.jira.issue.index.indexers.FieldIndexer

Base classes:

  • com.atlassian.jira.issue.index.indexers.impl.BaseFieldIndexer
  • com.atlassian.jira.issue.index.indexers.impl.AbstractCustomFieldIndexer


Deprecated indexers are registered into Jira by the following SPI which is also deprecated:

  • com.atlassian.jira.issue.search.searchers.information.SearcherInformation#getRelatedIndexers()

Implement com.atlassian.jira.search.issue.index.indexers.FieldIndexer instead, or extend one of its base classes:

  • com.atlassian.jira.search.issue.index.indexers.impl.VisibilityBaseFieldIndexer

  • com.atlassian.jira.search.issue.index.indexers.impl.BaseCustomFieldIndexer

Use the following SPI to register new indexers:

  • com.atlassian.jira.issue.search.searchers.information.SearcherInformation#getIndexers()

Lucene

org.apache.lucene.document.Document

To read indexed documents, use com.atlassian.jira.search.Document instead.

To index into a document, use com.atlassian.jira.search.field.FieldValueCollector instead.
Also see:

  • com.atlassian.jira.search.issue.index.indexers.FieldIndexer

  • com.atlassian.jira.search.entity.EntityIndexExtractor

Lucene

org.apache.lucene.search.Query

代わりに com.atlassian.jira.search.Query を使用します。

非推奨の実装では、空のクエリは match none クエリになります。それに比べて、OpenSearch に対応する新しい検索 API では、空のクエリは match all クエリではありません。

空のクエリを QueryFactoryResult.createFalseResult() に置き換えることができます。

jira-api

DocumentConstants#LUCENE_SORTFIELD_PREFIX

代わりに #SORTFIELD_PREFIX を使用します。

jira-api

com.atlassian.jira.issue.index.SecurityIndexingUtils methods that return a org.apache.lucene.util.ByteRef:

  • generateProjectPermissionFieldContents(...)

  • generateIssueLevelPermissionContents(...)

Use these following methods that return a String instead:

  • generateProjectPermissionFieldContentString(...)

  • generateIssueLevelPermissionContentString(...)

jira-api

com.atlassian.jira.util.index.IndexLifecycleManager methods:

  • isIndexAvailable()

  • isIndexConsistent()

  • getAllIndexPaths()

No replacements. These methods are Lucene specific, not relevant on OpenSearch going forward.

jira-core

com.atlassian.jira.index.EntityDocumentFactory and its subtypes:

  1. com.atlassian.jira.issue.index.ChangeHistoryDocumentFactory

  2. com.atlassian.jira.issue.index.CommentDocumentFactory

  3. com.atlassian.jira.issue.index.IssueDocumentFactory

  4. com.atlassian.jira.issue.index.WorklogDocumentFactory

Use these interfaces instead:

  1. com.atlassian.jira.search.issue.index.ChangeHistoryFieldValuesFactory

  2. com.atlassian.jira.search.issue.index.CommentFieldValuesFactory (will come in a future version)

  3. com.atlassian.jira.search.issue.index.IssueFieldValuesFactory

  4. com.atlassian.jira.search.issue.index.WorklogFieldValuesFactory (will come in a future version)

Lucene

org.apache.lucene.search.IndexSearcher, including its subtypes:

  • com.atlassian.jira.index.ManagedIndexSearcher

  • com.atlassian.jira.index.UnmanagedIndexSearcher

代わりに com.atlassian.jira.search.index.IndexSearcher を使用します。

jira-lucene-dmz

com.atlassian.jira.issue.search.SearchProvider

代わりに com.atlassian.jira.search.issue.IssueDocumentSearchService を使用します。

jira-lucene-dmz

com.atlassian.jira.issue.search.SearchProviderFactory

com.atlassian.jira.search.index.IndexAccessorRegistry を使用する

  • If searching for issues, use getIssuesIndexAccessor to get IndexAccessor

  • Otherwise, use getOrCreate(final String indexName) to get IndexAccessor

Then get IndexSearcher from IndexAccessor

jira-lucene-dmz

com.atlassian.jira.issue.search.parameters.lucene.JiraBytesRef

No replacement. These methods are Lucene specific, not relevant on OpenSearch going forward.

jira-lucene-dmz

com.atlassian.jira.issue.search.parameters.lucene.sort.JiraLuceneFieldFinder

No replacement. These methods are Lucene specific, not relevant on OpenSearch going forward.

jira-core

com.atlassian.jira.search.IndexConsistencyChecker

No replacements. This class is Lucene specific, not relevant on OpenSearch going forward.

jira-lucene-dmz

com.atlassian.jira.issue.search.SearchQuery

Use com.atlassian.jira.search.request.SearchRequest instead for document based search, or com.atlassian.jira.issue.search.SearchRequest for issue search.

jira-lucene-dmz

com.atlassian.jira.issue.index.IssueIndexManager

代わりに com.atlassian.jira.search.index.IndexAccessor または com.atlassian.jira.issue.index.IssueIndexer を使用してください。

jira-lucene-dmz

com.atlassian.jira.issue.index.TemporaryIndexProvider

This class only supports Lucene index which is deprecated. No replacements to support other search platforms such as OpenSearch.

Lucene

org.apache.lucene.search.Collector

代わりに com.atlassian.jira.search.index.IndexSearcher#scan(SearchRequest request, Function<Document, Boolean> callback) を使用します。

これにより、インデックスから一致するすべてのドキュメントがスキャンされます。ただし、集計 (count、sum など) の実行には推奨されません。OpenSearch で実行すると、ネットワーク上で不必要に大量のデータが転送され、パフォーマンスが低下するためです。アトラシアンでは、現在、OpenSearch の集計 API を利用してこれを効率的に行う Jira検索 API に集計サポートを導入するよう取り組んでいます。これは Jira 10 の将来のバージョンで提供される予定です。

REST API

PUT: /api/2/cluster/index-snapshot/{nodeId}

The Jira Data Center REST API

No replacements. This endpoint is Lucene specific, not relevant for the Search API or OpenSearch going forward.

jira-api

このモジュールは Jira 10.5 で非推奨になりました。

com.atlassian.jira.issue.customfields.SortableCustomField

com.atlassian.jira.issue.fields.CustomField#compare()

非推奨の SortableCustomField インターフェイスは、課題をソートするための比較機能を備えています。これは、ソートに対応したカスタム フィールド サーチャーにカスタム フィールドが関連付けられていない場合に代わりに使用されます。

ソート機能付きのカスタム フィールド サーチャーをすでに使用しているカスタム フィールドでは、追加の変更なしで SortableCustomField を削除できます。ソートに SortableCustomField を使用するカスタム フィールドでは、ソート機能付きのカスタム フィールド サーチャーを実装し、それをカスタム フィールド タイプに関連付ける必要があります。

同等のカスタム フィールド サーチャーの実装を次に示します。

  • FieldSortsCustomFieldSearcher を実装します。
  • getFieldSorts() で、DefaultValueLoaderFieldSort を返します。
  • FieldValueLoaderDefaultValueLoaderFieldSort に渡して、非推奨の SortableCustomField#Compare で使用されるのと同じ比較ロジックを備えた getComparator() を実装します。

NaturalFieldSort など、他のより効率的なソート タイプは、可能な限り ValueLoaderFieldSort より優先して使用してください。

複数値フィールドの場合、SortableCustomField ではその課題のフィールド値の完全なリストを使用する比較機能を実装できます。ValueLoaderFieldSortcan では 1 つの値だけを比較します。課題のフィールドに複数の値がある場合、その課題を他の課題と比較するために最も小さい値が使用されます (DefaultValueLoaderFieldSort#getComparator() に基づく)。

jira-core

このモジュールは Jira 10.5 で非推奨になりました。

com.atlassian.jira.issue.fields.ImmutableCustomField#compare()

com.atlassian.jira.issue.fields.ImmutableCustomField#getSortComparatorSource()

上記の com.atlassian.jira.issue.customfields.SortableCustomField の移行に関する注意事項を参照してください。

最終更新日: 2025 年 2 月 26 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.