Skip to content

Commit df52b00

Browse files
committed
OpenConceptLab/ocl_issues#2252 | repo/collections/sources facets to include retired facet
1 parent 6e6eb36 commit df52b00

File tree

8 files changed

+13
-3
lines changed

8 files changed

+13
-3
lines changed

core/collections/documents.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ class Index:
3535
custom_validation_schema = fields.KeywordField(attr='custom_validation_schema', normalizer='lowercase')
3636
created_by = fields.KeywordField()
3737
repo_type = fields.KeywordField()
38+
retired = fields.KeywordField(attr='retired')
3839

3940
class Django:
4041
model = Collection
4142
fields = [
4243
'full_name',
4344
'revision_date',
44-
'retired',
4545
'experimental',
4646
'locked_date',
4747
'external_id',

core/collections/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ class Collection(DirtyFieldsMixin, ConceptContainerModel):
5959
'canonical_url': {'sortable': False, 'filterable': True, 'exact': True},
6060
'experimental': {'sortable': False, 'filterable': False, 'facet': False},
6161
'external_id': {'sortable': False, 'filterable': True, 'facet': False, 'exact': True},
62+
'retired': {'sortable': False, 'filterable': True, 'facet': True},
6263
}
6364

6465
class Meta:

core/collections/search.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@ class CollectionFacetedSearch(CustomESFacetedSearch):
2222
'version': TermsFacet(field='version', size=FACET_SIZE),
2323
'customValidationSchema': TermsFacet(field='custom_validation_schema'),
2424
'updatedBy': TermsFacet(field='updated_by', size=FACET_SIZE),
25+
'retired': TermsFacet(field='retired'),
2526
}

core/repos/search.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,6 @@ class RepoFacetedSearch(CustomESFacetedSearch):
2626
'locale': TermsFacet(field='locale', size=FACET_SIZE),
2727
'owner': TermsFacet(field='owner', size=FACET_SIZE),
2828
'ownerType': TermsFacet(field='owner_type'),
29-
'repoType': TermsFacet(field='repo_type')
29+
'repoType': TermsFacet(field='repo_type'),
30+
'retired': TermsFacet(field='retired')
3031
}

core/repos/views.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@
101101
'facet': False,
102102
'exact': True
103103
},
104+
'retired': {
105+
'sortable': False,
106+
'filterable': True,
107+
'facet': True
108+
},
104109
}
105110

106111

core/sources/documents.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ class Index:
4040
filter_codes = fields.ListField(fields.KeywordField())
4141
match_algorithm = fields.ListField(fields.KeywordField())
4242
repo_type = fields.KeywordField()
43+
retired = fields.KeywordField(attr='retired')
4344

4445
class Django:
4546
model = Source
4647
fields = [
4748
'full_name',
4849
'revision_date',
49-
'retired',
5050
'experimental',
5151
'case_sensitive',
5252
'compositional',

core/sources/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ class Source(DirtyFieldsMixin, ConceptContainerModel):
4949
'hierarchy_meaning': {'sortable': False, 'filterable': True, 'facet': True},
5050
'external_id': {'sortable': False, 'filterable': True, 'facet': False, 'exact': True},
5151
'match_algorithm': {'sortable': False, 'filterable': True, 'facet': True, 'exact': False},
52+
'retired': {'sortable': False, 'filterable': True, 'facet': True},
5253
}
5354

5455
class Meta:

core/sources/search.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,5 @@ class SourceFacetedSearch(CustomESFacetedSearch):
2828
'hierarchyMeaning': TermsFacet(field='hierarchy_meaning', size=FACET_SIZE),
2929
'updatedBy': TermsFacet(field='updated_by', size=FACET_SIZE),
3030
'matchAlgorithm': TermsFacet(field='match_algorithm', size=FACET_SIZE),
31+
'retired': TermsFacet(field='retired'),
3132
}

0 commit comments

Comments
 (0)