It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

is there any sample plugin code for Data center which uses the lucene index

Hello Team,
I want to index plugin specific data in lucene & use it for the searching just like the way search issue of jira.
is there any sample plugin for Data center which uses the lucene index ?
my requirement is specific to jira data center.


1 answer

0 votes

Hi, is this data related to issue?

If yes the solution are custom fields and this works "for free" in DC. 

If a plugin wants to have its own index, then Jira does not provide any service for such functionality and this would require some significant amount of work to make it work in DC. 

Please let me know what kind of data you need to index?


Hello Mac,

Thanks for your reply.
I'm developing an addon which needs some data to be indexed in order to fast & efficient text based search (just like jira does for search issue) using lucene.

If there is a sample plugin which is leveraging the lucene for text based search & working in jira DC environment then it can help me to solve the usecase.
Let me know if you need any more details.


Hi Hash,

I still would like to know if this data is related to issues. 

Also you wrote:

 use it for the searching just like the way search issue 

Do you mean search it via JQL or directly using Lucene. 


Hello Mac,

The data is related to my addon, I will index following details from jira issue id, project id & version id. 

I have to implement my own version of query language i.e. directly using lucene. you can say that similar like JQL.

For eg, using my addon if I will search projectId = 10000 & samplePluginKey="info" then it should return the matched data.



If this data is related to issue, why not make it part of the existing issue index?

With your own index there are few challenging problems you will have to solve in DC:

* take care of replicating the indexing operation on all other nodes (Jira is currently communicating this via the DB but this may change in future)

* by default in Jira >= 8.0 runs with periodic commits so you would need to take care of replaying the index operations which did not make it into the index on previous shutdown (applies to this and all other nodes)

These are just the biggest problems you would need to take care of. 

I would really discourage you from taking this path.


I'm not sure, if I can use the jira index because I have lot of other information.
I have finalized the strategy on replicating index on other nodes by inserting data in database & polling the database at other nodes.
I just wanted to check how the jira lucene setup works & I can implement in the similar way. Really appreciate your help if I can get some documentation on how jira indexing works at code level.


Hi Harsh, 

Jira doesn't provide any API for such functionality. We can't really enforce it but we strongly recommend plugins to stick to use the existing API. 

If a plugin would create a Lucene index - it will be responsible for the whole lifecycle of the index: creating, replicating, replaying on start, automatic index distribution (after full re-index on one node, when new node joins the cluster), backing up etc. This is not part of the JIRA API, so would have to be handled by the plugin itself.  Not sure how can I help you with this. This is a huge subject.

Is this an internal plugin? If you have control over the infrastructure maybe you could use an external indexing service for the plugin data. This would resolve many of the index lifecycle problems which needs to be solved with local Lucene indexes in a Jira DC environment. 


Hello Mac,

I understand that I have to manage the complete lifecycle from creating to replicating to other nodes & covering the edge cases like node rejoins the cluster/ node restarts/ backup-recovery / syncing of node.

I have to develop a plugin which can leverage lucene for text based search. I don't have control over external indexing search tool.
As said above, I need some reference to use lucene in DC environment. As I can see Jira utilizes the lucene for jira-issue data so I thought I can get some lead in developing the plugin.


Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Jira

Calling all Jira Cloud users! Give us feedback on our exploration of a new navigation.

Hi everyone! My name’s Matt and I’m a product manager at Atlassian. I work in the navigation & findability space for all our Jira Cloud products. We’ve been working on trying to improve the exp...

1,051 views 16 12
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you