I've posted across in the Developer community forum. You can see the question here: https://community.developer.atlassian.com/t/incorrect-usage-of-jira-lucene-search-api-for-searchservice-search-in-jira-server-8-0-0-m0021-eap07/25266
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.