Skip to content

Commit

Permalink
Merge pull request #280 from performant-software/feature/basira272_do…
Browse files Browse the repository at this point in the history
…cuments_count

BASIRA #272 - Documents count
  • Loading branch information
dleadbetter authored Dec 11, 2024
2 parents 7f45260 + e7dc9bd commit f2a0eea
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/models/search/artwork.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module Artwork
search_attribute :id
search_attribute :date_descriptor
search_attribute :date_start
search_attribute :documents_count, facet: true
search_attribute :object_work_type, object: 'Artwork', group: 'Object/Work Type', multiple: true, facet: true
search_attribute :materials, object: 'Artwork', group: 'Material', multiple: true, facet: true
search_attribute :techniques, object: 'Artwork', group: 'Technique', multiple: true, facet: true
Expand Down
8 changes: 8 additions & 0 deletions client/src/components/SearchFacets.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,14 @@ const SearchFacets = (props: any) => {
toggleable
useRefinementList={useRefinementList}
/>
<FacetSlider
attribute='artwork.documents_count_facet'
defaultActive={false}
editable
ref={setRef}
title={getLabel('artwork.documents_count_facet')}
useRangeSlider={useRange}
/>
<Header
as='h3'
content={t('Search.facets.headers.visualContext')}
Expand Down
1 change: 1 addition & 0 deletions client/src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@
"nationality": "Creator Origin"
},
"dateRange": "Date",
"documentsCount": "Number of Documents",
"materials": "Materials",
"locations": {
"name": "Repository",
Expand Down
7 changes: 7 additions & 0 deletions typesense/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@
"optional": true,
"range_index": true
},
{
"name": "artwork.documents_count_facet",
"type": "int32",
"facet": true,
"optional": true,
"range_index": true
},
{
"name": "artwork.materials_facet",
"type": "string[]",
Expand Down

0 comments on commit f2a0eea

Please sign in to comment.