Skip to content

Commit

Permalink
issue #1077: sf
Browse files Browse the repository at this point in the history
  • Loading branch information
mrk-vi committed Sep 3, 2024
1 parent 263abb0 commit 800dad4
Showing 1 changed file with 25 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<Object, NamedXContentRegistry> 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<String> supportedHeadersName;

@POST
@Path("/search-query")
@Produces(MediaType.APPLICATION_JSON)
Expand Down Expand Up @@ -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<String> supportedHeadersName;

private final Map<Object, NamedXContentRegistry> 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()) {
Expand Down

0 comments on commit 800dad4

Please sign in to comment.