Commit 537d42a5 by Clinton Blackburn Committed by GitHub

Exposed Program.status field in Search API results (#187)

ECOM-5077
parent 5bc427e2
...@@ -46,10 +46,12 @@ COURSE_RUN_SEARCH_FIELDS = ( ...@@ -46,10 +46,12 @@ COURSE_RUN_SEARCH_FIELDS = (
PROGRAM_FACET_FIELD_OPTIONS = { PROGRAM_FACET_FIELD_OPTIONS = {
'category': {}, 'category': {},
'status': {},
} }
PROGRAM_SEARCH_FIELDS = ( PROGRAM_SEARCH_FIELDS = (
'uuid', 'title', 'subtitle', 'category', 'marketing_url', 'organizations', 'content_type', 'image_url', 'text', 'text', 'uuid', 'title', 'subtitle', 'category', 'marketing_url', 'organizations', 'content_type', 'image_url',
'status',
) )
......
...@@ -404,5 +404,6 @@ class ProgramSearchSerializerTests(TestCase): ...@@ -404,5 +404,6 @@ class ProgramSearchSerializerTests(TestCase):
'organizations': [OrganizationsMixin.format_organization(organization)], 'organizations': [OrganizationsMixin.format_organization(organization)],
'content_type': 'program', 'content_type': 'program',
'image_url': program.image_url, 'image_url': program.image_url,
'status': program.status,
} }
self.assertDictEqual(serializer.data, expected) self.assertDictEqual(serializer.data, expected)
...@@ -114,3 +114,4 @@ class ProgramIndex(OrganizationsMixin, BaseIndex, indexes.Indexable): ...@@ -114,3 +114,4 @@ class ProgramIndex(OrganizationsMixin, BaseIndex, indexes.Indexable):
marketing_url = indexes.CharField(model_attr='marketing_url', null=True) marketing_url = indexes.CharField(model_attr='marketing_url', null=True)
organizations = indexes.MultiValueField(faceted=True) organizations = indexes.MultiValueField(faceted=True)
image_url = indexes.CharField(model_attr='image_url', null=True) image_url = indexes.CharField(model_attr='image_url', null=True)
status = indexes.CharField(model_attr='status', faceted=True)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment