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.
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.
Can anyone please look into this and give your thoughts on this. Thankyou
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.
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.