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

Robert Courtney November 27, 2018

1 answer

0 votes
Gonchik Tsymzhitov
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
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