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.

Thanks,
Harsh

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?

mac

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.


Thanks,
Harsh

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. 

mac

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.

Thanks,

Harsh

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.

mac

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.

Thanks,
Harsh

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. 

mac

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.

Thanks,
Harsh

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Posted Wednesday in Jira

Upcoming Enterprise releases targeting Q3 2019: Jira Software 8.5 & Jira Service Desk 4.5

Since launching the Jira Software 8.0 and Jira Service Desk 4.0 platform releases in February, many of you have been asking when the next Enterprise release will be so you can take advantage of the m...

297 views 3 7
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you