Skip to content

Commit

Permalink
NickAkhmetov/CAT-419 Filter collections without DOI from being counte…
Browse files Browse the repository at this point in the history
…d on homepage (#3564)
  • Loading branch information
NickAkhmetov authored Oct 9, 2024
1 parent 14013f1 commit 8144804
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG-cat-419.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Prevent collections without a DOI from being counted on the homepage.
15 changes: 14 additions & 1 deletion context/app/static/js/components/home/EntityCounts/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,20 @@ import useSearchData from 'js/hooks/useSearchData';

const entityCountsQuery: SearchRequest = {
size: 0,
aggs: { entity_type: { terms: { field: 'entity_type.keyword' } } },
query: {
bool: {
// Only include collections with a DOI in count
should: [
{ bool: { must_not: { term: { 'entity_type.keyword': 'Collection' } } } },
{ bool: { must: [{ exists: { field: 'doi_url' } }, { exists: { field: 'registered_doi' } }] } },
],
},
},
aggs: {
entity_type: {
terms: { field: 'entity_type.keyword' },
},
},
};

interface EntityCounts {
Expand Down

0 comments on commit 8144804

Please sign in to comment.