File tree Expand file tree Collapse file tree 4 files changed +18
-1
lines changed
Expand file tree Collapse file tree 4 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ class Index:
3434 immutable = fields .KeywordField (attr = 'immutable' )
3535 custom_validation_schema = fields .KeywordField (attr = 'custom_validation_schema' , normalizer = 'lowercase' )
3636 created_by = fields .KeywordField ()
37+ repo_type = fields .KeywordField ()
3738
3839 class Django :
3940 model = Collection
@@ -145,3 +146,7 @@ def prepare_created_by(instance):
145146 @staticmethod
146147 def prepare__canonical_url (instance ):
147148 return format_url_for_search (instance .canonical_url )
149+
150+ @staticmethod
151+ def prepare_repo_type (_ ):
152+ return Collection .OBJECT_TYPE
Original file line number Diff line number Diff line change @@ -25,5 +25,6 @@ class RepoFacetedSearch(CustomESFacetedSearch):
2525 'customValidationSchema' : TermsFacet (field = 'custom_validation_schema' ),
2626 'locale' : TermsFacet (field = 'locale' , size = FACET_SIZE ),
2727 'owner' : TermsFacet (field = 'owner' , size = FACET_SIZE ),
28- 'ownerType' : TermsFacet (field = 'owner_type' )
28+ 'ownerType' : TermsFacet (field = 'owner_type' ),
29+ 'repoType' : TermsFacet (field = 'repo_type' )
2930 }
Original file line number Diff line number Diff line change 1111from core .repos .serializers import RepoListSerializer
1212
1313es_fields = {
14+ 'repo_type' : {
15+ 'sortable' : True ,
16+ 'filterable' : True ,
17+ 'facet' : True ,
18+ 'exact' : True
19+ },
1420 'source_type' : {
1521 'sortable' : True ,
1622 'filterable' : True ,
Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ class Index:
3939 property_codes = fields .ListField (fields .KeywordField ())
4040 filter_codes = fields .ListField (fields .KeywordField ())
4141 match_algorithm = fields .ListField (fields .KeywordField ())
42+ repo_type = fields .KeywordField ()
4243
4344 class Django :
4445 model = Source
@@ -185,3 +186,7 @@ def prepare_hierarchy_meaning(instance):
185186 @staticmethod
186187 def prepare__canonical_url (instance ):
187188 return format_url_for_search (instance .canonical_url )
189+
190+ @staticmethod
191+ def prepare_repo_type (_ ):
192+ return Source .OBJECT_TYPE
You can’t perform that action at this time.
0 commit comments