diff --git a/core/app/searcher/src/main/java/io/openk9/searcher/resource/SearchResource.java b/core/app/searcher/src/main/java/io/openk9/searcher/resource/SearchResource.java index 632e8545f..944632d5a 100644 --- a/core/app/searcher/src/main/java/io/openk9/searcher/resource/SearchResource.java +++ b/core/app/searcher/src/main/java/io/openk9/searcher/resource/SearchResource.java @@ -89,6 +89,31 @@ @RequestScoped public class SearchResource { + private static final Logger logger = Logger.getLogger(SearchResource.class); + private static final Object namedXContentRegistryKey = new Object(); + private static final Pattern i18nHighlithKeyPattern = Pattern.compile( + "\\.i18n\\..{5,}$|\\.base$"); + private final Map namedXContentRegistryMap = + Collections.synchronizedMap(new IdentityHashMap<>()); + @GrpcClient("searcher") + Searcher searcherClient; + @Inject + @Claim(standard = Claims.raw_token) + String rawToken; + @Inject + SearcherMapper searcherMapper; + @Inject + InternalSearcherMapper internalSearcherMapper; + @Inject + RestHighLevelClient restHighLevelClient; + @Context + HttpServerRequest request; + @Context + HttpHeaders + headers; + @ConfigProperty(name = "openk9.searcher.supported.headers.name", defaultValue = "OPENK9_ACL") + List supportedHeadersName; + @POST @Path("/search-query") @Produces(MediaType.APPLICATION_JSON) @@ -610,36 +635,6 @@ private Response toSearchResponse(SearchResponse searchResponse) { return new Response(result, totalHits.value); } - private static final Logger logger = Logger.getLogger(SearchResource.class); - @GrpcClient("searcher") - Searcher searcherClient; - - @Inject - @Claim(standard = Claims.raw_token) - String rawToken; - @Inject - SearcherMapper searcherMapper; - @Inject - InternalSearcherMapper internalSearcherMapper; - @Inject - RestHighLevelClient restHighLevelClient; - - @Context - HttpServerRequest request; - - @Context - HttpHeaders - headers; - - @ConfigProperty(name = "openk9.searcher.supported.headers.name", defaultValue = "OPENK9_ACL") - List supportedHeadersName; - - private final Map namedXContentRegistryMap = - Collections.synchronizedMap(new IdentityHashMap<>()); - - private static final Object namedXContentRegistryKey = new Object(); - private static final Pattern i18nHighlithKeyPattern = Pattern.compile("\\.i18n\\..{5,}$|\\.base$"); - private void printShardFailures(SearchResponse searchResponse) { if (searchResponse.getShardFailures() != null) { for (ShardSearchFailure failure : searchResponse.getShardFailures()) {