Approvals Plugin: Atlassian Jira 8.13.6 is returning empty results with LuceneSearch

Ratnakar Neelati December 8, 2021

I am working on Approvals plugin with Jira 8.13.6.   Was stuck with Lucene search functionality where need to get/search the list of issues associated with an artifact from BitBucket/Git.

Requirement: To Get the List of Issues by LuceneSearch with "Artifacts" as input. 

Ex: http://localhost:PORTNO/context_path/repos/rep_1/Branch_name/file/file_name.txt. (sample Path)

Query: Artifacts in ("http://localhost:PORTNO/context_path/repos/rep_1/Branch_name/file/file_name.txt?at=refs/head/branch_name", "http://localhost:PORTNO/context_path/repos/rep_1/Branch_name/file/file_name.txt?at=812ssjlsjl778")

Note: 812ssjlsjl778 is the git revision commit id.

This jql query is returning empty results only in  Jira 8.13.6 but with

Jira 7.x version and Lucen dependency 3.3 version same JQL query is working perfectly.

 

Troubleshoot: Verified whether  Lucene is correctly indexing my inputs passed to search functionality and Lucene is correctly indexing the input. 

Lucene dependency version: 7.3.1

Jira: 8.13.6

Request to please let me know your inputs or thoughts on this? Please let me know if you need more information.

 

Thanks in Advance.

 

 

1 answer

0 votes
Ratnakar Neelati December 10, 2021

Can anyone please look into this and give your thoughts on this. Thankyou

Ratnakar Neelati January 23, 2022

Hello All, I have identified the issue

We are not getting search results because Lucene is tokenizing the text data as below which should not happen in our use case because of  this search functionality is returning 0 results as the search test data is not matching to the Lucene indexed value. Refer below screen shot.Capture.JPG

Lucene by-default uses analyzer as StandardAnalyzer  which  is tokenizing the data.

Since use case is about search functionality using file paths we need to use

Approach 1. specific analyzer other than StandardAnalyzer or

Approach 2. need to inform to Lucene that tokenize but as a single token

 Lucene, is the process of converting field text into its most fundamental indexed representation, terms. These terms are used to determine what documents match a query during searching. Based on this found that String Filed is not analyzed  and hold the value into single token.

Capture2.JPG

doc.add(new StringField(getDocumentFieldId(), cutomizeindexableURI(uri), Field.Store.YES));

With Approach 2, replaced the "Text Field" with "String Field" we are able to successfully get the search results.

StringField: String field is indexed but not analyzed. Entire string value is stored as single token. It is useful to store ids, phone numbers, country fields etc.,

TextField: Text field is indexed and tokenized, without term vectors. If you want full-text searching use this field.

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events