Available: | Jira 11.3.2 and later. |
The query mapper plugin modules allow apps to have their own query mappers, mapping custom query types to the corresponding search engine queries. These modules handle query mapper registration for you, so you no longer need to get the registry or call the register and deregister methods.
Each module consists of two configurations, one for each search platform that Jira supports: Lucene and OpenSearch. Your app should provide two custom query mappers for every custom query type: one for Lucene and one for OpenSearch.
The root element for the query mapper plugin module is:
lucene-query-mapper for Luceneopensearch-query-mapper for OpenSearch.Each element allows the below attributes and child elements for configuration.
| Name | Description |
|---|---|
| key | The unique identifier of the plugin module. |
| name | The human-readable name of the plugin module. |
| class | The fully qualified Lucene or OpenSearch query mapper class name. Implement LuceneQueryMapper or OpenSearchQueryMapper accordingly. |
| Name | Description |
|---|---|
| query-class | The fully qualified class name of the custom query. This element is required and must implement the Query interface. |
To register a custom query mapper, place the following code sample in atlassian-plugin.xml:
1 2<lucene-query-mapper key="reference-regexp-lucene-mapper" name="Reference Regexp Lucene Mapper" class="com.atlassian.jira.dev.reference.plugin.search.lucene.query.mappers.RegexpQueryMapper"> <query-class>com.atlassian.jira.dev.reference.plugin.search.query.RegexpQuery</query-class> </lucene-query-mapper> <opensearch-query-mapper key="reference-regexp-opensearch-mapper" name="Reference Regexp OpenSearch Mapper" class="com.atlassian.jira.dev.reference.plugin.search.opensearch.query.mappers.RegexpQueryMapper"> <query-class>com.atlassian.jira.dev.reference.plugin.search.query.RegexpQuery</query-class> </opensearch-query-mapper>
If you need, you can create custom query mappers and register them for Lucene or OpenSearch. How to implement custom query mappers
Rate this page: