Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

"Incorrect usage of JIRA/lucene search API" for SearchService.search in JIRA server 8.0.0-m0021

Robert Courtney
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 27, 2018

1 answer

0 votes
Gonchik Tsymzhitov
Community Champion
January 3, 2021

And looks fix based on the next comment

Since my app is executing in a parallel thread, I could not use JiraThreadLocalUtil since that was cleaning all threads that are executing - provoking errors in other Jira modules, like attachment, activity log,…

My solution was to start searcher context manually for my thread before calling searchProvider (or searchService)

      try {
        ThreadLocalSearcherCache.startSearcherContext();
        return searchProvider.getHitCount(searchQuery);
    } finally {
        ThreadLocalSearcherCache.stopAndCloseSearcherContext();
    }

Regards,
Dusan

Suggest an answer

Log in or Sign up to answer