Skip to content

Commit

Permalink
Filter out HandleAction in search results
Browse files Browse the repository at this point in the history
Provisional solution. Should the these never be indexed?
Should they be added to siteFilter? Using a special Record type?
  • Loading branch information
olovy committed Nov 21, 2023
1 parent bde9d9f commit 11d3421
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions whelk-core/src/main/groovy/whelk/search/ESQuery.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -261,12 +261,19 @@ class ESQuery {
query['from'] = offset
}

// FIXME: How should these be filtered?
// Never index them at all?
// not-meta.@type=AdminRecord ?
def recordFilter = [['bool': ['must_not': createBoolFilter(['@type': ['HandleAction']])]]]

if (filters && siteFilter) {
query['query']['bool']['filter'] = filters + siteFilter
query['query']['bool']['filter'] = recordFilter + filters + siteFilter
} else if (filters) {
query['query']['bool']['filter'] = filters
query['query']['bool']['filter'] = recordFilter + filters
} else if (siteFilter) {
query['query']['bool']['filter'] = siteFilter
query['query']['bool']['filter'] = recordFilter + siteFilter
} else {
query['query']['bool']['filter'] = recordFilter
}

if (sortBy) {
Expand Down

0 comments on commit 11d3421

Please sign in to comment.