diff --git a/repository/src/main/java/org/apache/atlas/discovery/EntityDiscoveryService.java b/repository/src/main/java/org/apache/atlas/discovery/EntityDiscoveryService.java index 76e1e798bd..4b76be8cac 100644 --- a/repository/src/main/java/org/apache/atlas/discovery/EntityDiscoveryService.java +++ b/repository/src/main/java/org/apache/atlas/discovery/EntityDiscoveryService.java @@ -1181,21 +1181,24 @@ private void addPreFiltersToSearchQuery(SearchParams searchParams) { Map allPreFiltersBoolClause = NewAuthorizerUtils.getPreFilterDsl(persona, purpose, actions); mustClauseList.add(allPreFiltersBoolClause); + mustClauseList.add((Map) ((IndexSearchParams) searchParams).getDsl().get("query")); + String dslString = searchParams.getQuery(); JsonNode node = mapper.readTree(dslString); - JsonNode userQueryNode = node.get("query"); + /*JsonNode userQueryNode = node.get("query"); if (userQueryNode != null) { String userQueryString = userQueryNode.toString(); String userQueryBase64 = Base64.getEncoder().encodeToString(userQueryString.getBytes()); mustClauseList.add(getMap("wrapper", getMap("query", userQueryBase64))); - } + }*/ JsonNode updateQueryNode = mapper.valueToTree(getMap("bool", getMap("must", mustClauseList))); ((ObjectNode) node).set("query", updateQueryNode); searchParams.setQuery(node.toString()); + RequestContext.get().endMetricRecord(addPreFiltersToSearchQueryMetric); } catch (Exception e) {