Skip to content

Commit

Permalink
Exclude _original_source from ES queries on the default view
Browse files Browse the repository at this point in the history
  • Loading branch information
shinyhappydan committed Jan 9, 2024
1 parent b5d41bb commit dc58b06
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ object DefaultViewsQuery {

type Elasticsearch = DefaultViewsQuery[SearchResults[JsonObject], AggregationResult]

private val excludeOriginalSource = "_source_excludes" -> "_original_source"

def apply(
aclCheck: AclCheck,
client: ElasticSearchClient,
Expand All @@ -52,7 +54,7 @@ object DefaultViewsQuery {
aclCheck,
(request: DefaultSearchRequest, views: Set[IndexingView]) =>
client
.search(request.params, views.map(_.index), Uri.Query.Empty)(request.pagination, request.sort)
.search(request.params, views.map(_.index), Uri.Query(excludeOriginalSource))(request.pagination, request.sort)
.adaptError { case e: HttpClientError => ElasticSearchClientError(e) },
(request: DefaultSearchRequest, views: Set[IndexingView]) =>
client
Expand Down

0 comments on commit dc58b06

Please sign in to comment.