Skip to content

Commit

Permalink
Adding the query implementation changes (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sahil-tarento authored Feb 19, 2024
1 parent c0be98f commit 825049b
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ public Future<Map<String, Object>> processSearch(SearchDTO searchDTO, boolean in
List<Map<String, Object>> groupByFinalList = new ArrayList<Map<String, Object>>();
SearchSourceBuilder query = processSearchQuery(searchDTO, groupByFinalList, true);

if (searchDTO.isSecureSettingsDisabled()) {
query.postFilter(getPostFilterQuery(searchDTO.getPostFilter()));
}

Future<SearchResponse> searchResponse = null;
boolean enableFuzzyWhenNoResults = Platform.config.hasPath("search.fields.enable.fuzzy.when.noresult") &&
Platform.config.getBoolean("search.fields.enable.fuzzy.when.noresult");
Expand All @@ -73,6 +69,11 @@ public Future<Map<String, Object>> processSearch(SearchDTO searchDTO, boolean in
query = processSearchQuery(searchDTO, groupByFinalList, true);
}
}

if (searchDTO.isSecureSettingsDisabled()) {
query.postFilter(getPostFilterQuery(searchDTO.getPostFilter()));
}

searchResponse = ElasticSearchUtil.search(SearchConstants.COMPOSITE_SEARCH_INDEX, query);

return searchResponse.map(new Mapper<SearchResponse, Map<String, Object>>() {
Expand Down

0 comments on commit 825049b

Please sign in to comment.