diff --git a/frontends/api/src/generated/v1/api.ts b/frontends/api/src/generated/v1/api.ts index 2cc2d9cbdb..ce5480002b 100644 --- a/frontends/api/src/generated/v1/api.ts +++ b/frontends/api/src/generated/v1/api.ts @@ -3401,6 +3401,12 @@ export interface PercolateQuerySubscriptionRequestRequest { * @memberof PercolateQuerySubscriptionRequestRequest */ topic?: Array + /** + * If true return raw open search results with score explanations + * @type {boolean} + * @memberof PercolateQuerySubscriptionRequestRequest + */ + dev_mode?: boolean | null /** * The id value for the learning resource * @type {Array} @@ -6612,6 +6618,7 @@ export const ContentFileSearchApiAxiosParamCreator = function ( * @summary Search * @param {Array} [aggregations] Show resource counts by category * @param {Array} [content_feature_type] The feature type of the content file. Possible options are at api/v1/course_features/ + * @param {boolean | null} [dev_mode] If true return raw open search results with score explanations * @param {Array} [id] The id value for the content file * @param {number} [limit] Number of results to return per page * @param {Array} [offered_by] The organization that offers the learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education @@ -6628,6 +6635,7 @@ export const ContentFileSearchApiAxiosParamCreator = function ( contentFileSearchRetrieve: async ( aggregations?: Array, content_feature_type?: Array, + dev_mode?: boolean | null, id?: Array, limit?: number, offered_by?: Array, @@ -6664,6 +6672,10 @@ export const ContentFileSearchApiAxiosParamCreator = function ( localVarQueryParameter["content_feature_type"] = content_feature_type } + if (dev_mode !== undefined) { + localVarQueryParameter["dev_mode"] = dev_mode + } + if (id) { localVarQueryParameter["id"] = id } @@ -6734,6 +6746,7 @@ export const ContentFileSearchApiFp = function (configuration?: Configuration) { * @summary Search * @param {Array} [aggregations] Show resource counts by category * @param {Array} [content_feature_type] The feature type of the content file. Possible options are at api/v1/course_features/ + * @param {boolean | null} [dev_mode] If true return raw open search results with score explanations * @param {Array} [id] The id value for the content file * @param {number} [limit] Number of results to return per page * @param {Array} [offered_by] The organization that offers the learning resource * `mitx` - MITx * `ocw` - MIT OpenCourseWare * `bootcamps` - Bootcamps * `xpro` - MIT xPRO * `mitpe` - MIT Professional Education * `see` - MIT Sloan Executive Education @@ -6750,6 +6763,7 @@ export const ContentFileSearchApiFp = function (configuration?: Configuration) { async contentFileSearchRetrieve( aggregations?: Array, content_feature_type?: Array, + dev_mode?: boolean | null, id?: Array, limit?: number, offered_by?: Array, @@ -6771,6 +6785,7 @@ export const ContentFileSearchApiFp = function (configuration?: Configuration) { await localVarAxiosParamCreator.contentFileSearchRetrieve( aggregations, content_feature_type, + dev_mode, id, limit, offered_by, @@ -6825,6 +6840,7 @@ export const ContentFileSearchApiFactory = function ( .contentFileSearchRetrieve( requestParameters.aggregations, requestParameters.content_feature_type, + requestParameters.dev_mode, requestParameters.id, requestParameters.limit, requestParameters.offered_by, @@ -6862,6 +6878,13 @@ export interface ContentFileSearchApiContentFileSearchRetrieveRequest { */ readonly content_feature_type?: Array + /** + * If true return raw open search results with score explanations + * @type {boolean} + * @memberof ContentFileSearchApiContentFileSearchRetrieve + */ + readonly dev_mode?: boolean | null + /** * The id value for the content file * @type {Array} @@ -6956,6 +6979,7 @@ export class ContentFileSearchApi extends BaseAPI { .contentFileSearchRetrieve( requestParameters.aggregations, requestParameters.content_feature_type, + requestParameters.dev_mode, requestParameters.id, requestParameters.limit, requestParameters.offered_by, @@ -11642,6 +11666,7 @@ export const LearningResourcesSearchApiAxiosParamCreator = function ( * @param {Array} [certification_type] The type of certificate * `micromasters` - Micromasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate * @param {Array} [course_feature] The course feature. Possible options are at api/v1/course_features/ * @param {Array} [department] The department that offers the learning resource * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @param {boolean | null} [dev_mode] If true return raw open search results with score explanations * @param {boolean | null} [free] * @param {Array} [id] The id value for the learning resource * @param {Array} [learning_format] The format(s) in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person @@ -11666,6 +11691,7 @@ export const LearningResourcesSearchApiAxiosParamCreator = function ( certification_type?: Array, course_feature?: Array, department?: Array, + dev_mode?: boolean | null, free?: boolean | null, id?: Array, learning_format?: Array, @@ -11719,6 +11745,10 @@ export const LearningResourcesSearchApiAxiosParamCreator = function ( localVarQueryParameter["department"] = department } + if (dev_mode !== undefined) { + localVarQueryParameter["dev_mode"] = dev_mode + } + if (free !== undefined) { localVarQueryParameter["free"] = free } @@ -11814,6 +11844,7 @@ export const LearningResourcesSearchApiFp = function ( * @param {Array} [certification_type] The type of certificate * `micromasters` - Micromasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate * @param {Array} [course_feature] The course feature. Possible options are at api/v1/course_features/ * @param {Array} [department] The department that offers the learning resource * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @param {boolean | null} [dev_mode] If true return raw open search results with score explanations * @param {boolean | null} [free] * @param {Array} [id] The id value for the learning resource * @param {Array} [learning_format] The format(s) in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person @@ -11838,6 +11869,7 @@ export const LearningResourcesSearchApiFp = function ( certification_type?: Array, course_feature?: Array, department?: Array, + dev_mode?: boolean | null, free?: boolean | null, id?: Array, learning_format?: Array, @@ -11867,6 +11899,7 @@ export const LearningResourcesSearchApiFp = function ( certification_type, course_feature, department, + dev_mode, free, id, learning_format, @@ -11929,6 +11962,7 @@ export const LearningResourcesSearchApiFactory = function ( requestParameters.certification_type, requestParameters.course_feature, requestParameters.department, + requestParameters.dev_mode, requestParameters.free, requestParameters.id, requestParameters.learning_format, @@ -11992,6 +12026,13 @@ export interface LearningResourcesSearchApiLearningResourcesSearchRetrieveReques */ readonly department?: Array + /** + * If true return raw open search results with score explanations + * @type {boolean} + * @memberof LearningResourcesSearchApiLearningResourcesSearchRetrieve + */ + readonly dev_mode?: boolean | null + /** * * @type {boolean} @@ -12124,6 +12165,7 @@ export class LearningResourcesSearchApi extends BaseAPI { requestParameters.certification_type, requestParameters.course_feature, requestParameters.department, + requestParameters.dev_mode, requestParameters.free, requestParameters.id, requestParameters.learning_format, @@ -12344,6 +12386,7 @@ export const LearningResourcesUserSubscriptionApiAxiosParamCreator = function ( * @param {Array} [certification_type] The type of certificate * `micromasters` - Micromasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate * @param {Array} [course_feature] The course feature. Possible options are at api/v1/course_features/ * @param {Array} [department] The department that offers the learning resource * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @param {boolean | null} [dev_mode] If true return raw open search results with score explanations * @param {boolean | null} [free] * @param {Array} [id] The id value for the learning resource * @param {Array} [learning_format] The format(s) in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person @@ -12369,6 +12412,7 @@ export const LearningResourcesUserSubscriptionApiAxiosParamCreator = function ( certification_type?: Array, course_feature?: Array, department?: Array, + dev_mode?: boolean | null, free?: boolean | null, id?: Array, learning_format?: Array, @@ -12423,6 +12467,10 @@ export const LearningResourcesUserSubscriptionApiAxiosParamCreator = function ( localVarQueryParameter["department"] = department } + if (dev_mode !== undefined) { + localVarQueryParameter["dev_mode"] = dev_mode + } + if (free !== undefined) { localVarQueryParameter["free"] = free } @@ -12509,6 +12557,7 @@ export const LearningResourcesUserSubscriptionApiAxiosParamCreator = function ( * @param {Array} [certification_type] The type of certificate * `micromasters` - Micromasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate * @param {Array} [course_feature] The course feature. Possible options are at api/v1/course_features/ * @param {Array} [department] The department that offers the learning resource * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @param {boolean | null} [dev_mode] If true return raw open search results with score explanations * @param {boolean | null} [free] * @param {Array} [id] The id value for the learning resource * @param {Array} [learning_format] The format(s) in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person @@ -12533,6 +12582,7 @@ export const LearningResourcesUserSubscriptionApiAxiosParamCreator = function ( certification_type?: Array, course_feature?: Array, department?: Array, + dev_mode?: boolean | null, free?: boolean | null, id?: Array, learning_format?: Array, @@ -12586,6 +12636,10 @@ export const LearningResourcesUserSubscriptionApiAxiosParamCreator = function ( localVarQueryParameter["department"] = department } + if (dev_mode !== undefined) { + localVarQueryParameter["dev_mode"] = dev_mode + } + if (free !== undefined) { localVarQueryParameter["free"] = free } @@ -12668,6 +12722,7 @@ export const LearningResourcesUserSubscriptionApiAxiosParamCreator = function ( * @param {Array} [certification_type] The type of certificate * `micromasters` - Micromasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate * @param {Array} [course_feature] The course feature. Possible options are at api/v1/course_features/ * @param {Array} [department] The department that offers the learning resource * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @param {boolean | null} [dev_mode] If true return raw open search results with score explanations * @param {boolean | null} [free] * @param {Array} [id] The id value for the learning resource * @param {Array} [learning_format] The format(s) in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person @@ -12694,6 +12749,7 @@ export const LearningResourcesUserSubscriptionApiAxiosParamCreator = function ( certification_type?: Array, course_feature?: Array, department?: Array, + dev_mode?: boolean | null, free?: boolean | null, id?: Array, learning_format?: Array, @@ -12749,6 +12805,10 @@ export const LearningResourcesUserSubscriptionApiAxiosParamCreator = function ( localVarQueryParameter["department"] = department } + if (dev_mode !== undefined) { + localVarQueryParameter["dev_mode"] = dev_mode + } + if (free !== undefined) { localVarQueryParameter["free"] = free } @@ -12906,6 +12966,7 @@ export const LearningResourcesUserSubscriptionApiFp = function ( * @param {Array} [certification_type] The type of certificate * `micromasters` - Micromasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate * @param {Array} [course_feature] The course feature. Possible options are at api/v1/course_features/ * @param {Array} [department] The department that offers the learning resource * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @param {boolean | null} [dev_mode] If true return raw open search results with score explanations * @param {boolean | null} [free] * @param {Array} [id] The id value for the learning resource * @param {Array} [learning_format] The format(s) in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person @@ -12931,6 +12992,7 @@ export const LearningResourcesUserSubscriptionApiFp = function ( certification_type?: Array, course_feature?: Array, department?: Array, + dev_mode?: boolean | null, free?: boolean | null, id?: Array, learning_format?: Array, @@ -12961,6 +13023,7 @@ export const LearningResourcesUserSubscriptionApiFp = function ( certification_type, course_feature, department, + dev_mode, free, id, learning_format, @@ -13000,6 +13063,7 @@ export const LearningResourcesUserSubscriptionApiFp = function ( * @param {Array} [certification_type] The type of certificate * `micromasters` - Micromasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate * @param {Array} [course_feature] The course feature. Possible options are at api/v1/course_features/ * @param {Array} [department] The department that offers the learning resource * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @param {boolean | null} [dev_mode] If true return raw open search results with score explanations * @param {boolean | null} [free] * @param {Array} [id] The id value for the learning resource * @param {Array} [learning_format] The format(s) in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person @@ -13024,6 +13088,7 @@ export const LearningResourcesUserSubscriptionApiFp = function ( certification_type?: Array, course_feature?: Array, department?: Array, + dev_mode?: boolean | null, free?: boolean | null, id?: Array, learning_format?: Array, @@ -13053,6 +13118,7 @@ export const LearningResourcesUserSubscriptionApiFp = function ( certification_type, course_feature, department, + dev_mode, free, id, learning_format, @@ -13091,6 +13157,7 @@ export const LearningResourcesUserSubscriptionApiFp = function ( * @param {Array} [certification_type] The type of certificate * `micromasters` - Micromasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate * @param {Array} [course_feature] The course feature. Possible options are at api/v1/course_features/ * @param {Array} [department] The department that offers the learning resource * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Medical Engineering and Science * `IDS` - Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies + * @param {boolean | null} [dev_mode] If true return raw open search results with score explanations * @param {boolean | null} [free] * @param {Array} [id] The id value for the learning resource * @param {Array} [learning_format] The format(s) in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person @@ -13117,6 +13184,7 @@ export const LearningResourcesUserSubscriptionApiFp = function ( certification_type?: Array, course_feature?: Array, department?: Array, + dev_mode?: boolean | null, free?: boolean | null, id?: Array, learning_format?: Array, @@ -13145,6 +13213,7 @@ export const LearningResourcesUserSubscriptionApiFp = function ( certification_type, course_feature, department, + dev_mode, free, id, learning_format, @@ -13240,6 +13309,7 @@ export const LearningResourcesUserSubscriptionApiFactory = function ( requestParameters.certification_type, requestParameters.course_feature, requestParameters.department, + requestParameters.dev_mode, requestParameters.free, requestParameters.id, requestParameters.learning_format, @@ -13278,6 +13348,7 @@ export const LearningResourcesUserSubscriptionApiFactory = function ( requestParameters.certification_type, requestParameters.course_feature, requestParameters.department, + requestParameters.dev_mode, requestParameters.free, requestParameters.id, requestParameters.learning_format, @@ -13315,6 +13386,7 @@ export const LearningResourcesUserSubscriptionApiFactory = function ( requestParameters.certification_type, requestParameters.course_feature, requestParameters.department, + requestParameters.dev_mode, requestParameters.free, requestParameters.id, requestParameters.learning_format, @@ -13398,6 +13470,13 @@ export interface LearningResourcesUserSubscriptionApiLearningResourcesUserSubscr */ readonly department?: Array + /** + * If true return raw open search results with score explanations + * @type {boolean} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionCheckList + */ + readonly dev_mode?: boolean | null + /** * * @type {boolean} @@ -13552,6 +13631,13 @@ export interface LearningResourcesUserSubscriptionApiLearningResourcesUserSubscr */ readonly department?: Array + /** + * If true return raw open search results with score explanations + * @type {boolean} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionList + */ + readonly dev_mode?: boolean | null + /** * * @type {boolean} @@ -13699,6 +13785,13 @@ export interface LearningResourcesUserSubscriptionApiLearningResourcesUserSubscr */ readonly department?: Array + /** + * If true return raw open search results with score explanations + * @type {boolean} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionSubscribeCreate + */ + readonly dev_mode?: boolean | null + /** * * @type {boolean} @@ -13859,6 +13952,7 @@ export class LearningResourcesUserSubscriptionApi extends BaseAPI { requestParameters.certification_type, requestParameters.course_feature, requestParameters.department, + requestParameters.dev_mode, requestParameters.free, requestParameters.id, requestParameters.learning_format, @@ -13899,6 +13993,7 @@ export class LearningResourcesUserSubscriptionApi extends BaseAPI { requestParameters.certification_type, requestParameters.course_feature, requestParameters.department, + requestParameters.dev_mode, requestParameters.free, requestParameters.id, requestParameters.learning_format, @@ -13938,6 +14033,7 @@ export class LearningResourcesUserSubscriptionApi extends BaseAPI { requestParameters.certification_type, requestParameters.course_feature, requestParameters.department, + requestParameters.dev_mode, requestParameters.free, requestParameters.id, requestParameters.learning_format, diff --git a/learning_resources_search/api.py b/learning_resources_search/api.py index 08f2e3c045..1b076722f9 100644 --- a/learning_resources_search/api.py +++ b/learning_resources_search/api.py @@ -21,11 +21,11 @@ DEPARTMENT_QUERY_FIELDS, LEARNING_RESOURCE, LEARNING_RESOURCE_QUERY_FIELDS, - LEARNING_RESOURCE_SEARCH_FILTERS, LEARNING_RESOURCE_TYPES, RESOURCEFILE_QUERY_FIELDS, RUN_INSTRUCTORS_QUERY_FIELDS, RUNS_QUERY_FIELDS, + SEARCH_FILTERS, SOURCE_EXCLUDED_FIELDS, TOPICS_QUERY_FIELDS, ) @@ -340,7 +340,7 @@ def generate_filter_clauses(search_params): """ all_filter_clauses = {} - for filter_name, filter_config in LEARNING_RESOURCE_SEARCH_FILTERS.items(): + for filter_name, filter_config in SEARCH_FILTERS.items(): if search_params.get(filter_name): clauses_for_filter = [ generate_filter_clause( @@ -447,7 +447,7 @@ def generate_aggregation_clauses(search_params, filter_clauses): for aggregation in search_params.get("aggregations"): # Each aggregation clause contains a filter which includes all the filters # except it's own - path = LEARNING_RESOURCE_SEARCH_FILTERS[aggregation].path + path = SEARCH_FILTERS[aggregation].path unfiltered_aggs = generate_aggregation_clause(aggregation, path) other_filters = [ filter_clauses[key] for key in filter_clauses if key != aggregation @@ -486,7 +486,7 @@ def adjust_original_query_for_percolate(query): Remove keys that are irrelevent when storing original queries for percolate uniqueness such as "limit" and "offset" """ - for key in ["limit", "offset", "sortby", "yearly_decay_percent"]: + for key in ["limit", "offset", "sortby", "yearly_decay_percent", "dev_mode"]: query.pop(key, None) return order_params(query) @@ -622,6 +622,9 @@ def construct_search(search_params): ) search = search.extra(aggs=aggregation_clauses) + if search_params.get("dev_mode"): + search = search.extra(explain=True) + return search diff --git a/learning_resources_search/api_test.py b/learning_resources_search/api_test.py index 58d811d819..591c45cbde 100644 --- a/learning_resources_search/api_test.py +++ b/learning_resources_search/api_test.py @@ -2214,3 +2214,23 @@ def test_default_sort(sortby, q, result): } assert construct_search(search_params).to_dict().get("sort") == result + + +@pytest.mark.parametrize( + "dev_mode", + [True, False], +) +def test_dev_mode(dev_mode): + search_params = { + "aggregations": [], + "q": "text", + "limit": 1, + "offset": 1, + "dev_mode": dev_mode, + "endpoint": LEARNING_RESOURCE, + } + + if dev_mode: + assert construct_search(search_params).to_dict().get("explain") + else: + assert construct_search(search_params).to_dict().get("explain") is None diff --git a/learning_resources_search/constants.py b/learning_resources_search/constants.py index 60d203bda2..5e1788c6df 100644 --- a/learning_resources_search/constants.py +++ b/learning_resources_search/constants.py @@ -57,7 +57,7 @@ class FilterConfig: case_sensitive: bool = False -LEARNING_RESOURCE_SEARCH_FILTERS = { +SEARCH_FILTERS = { "resource_type": FilterConfig("resource_type"), "certification": FilterConfig("certification"), "certification_type": FilterConfig("certification_type.code"), @@ -67,7 +67,7 @@ class FilterConfig: "course_feature": FilterConfig("course_feature"), "content_feature_type": FilterConfig("content_feature_type"), "run_id": FilterConfig("run_id", case_sensitive=True), - "resource_id": FilterConfig("resource_id"), + "resource_id": FilterConfig("resource_id", case_sensitive=True), "topic": FilterConfig("topics.name"), "level": FilterConfig("runs.level.code"), "department": FilterConfig("departments.department_id"), diff --git a/learning_resources_search/serializers.py b/learning_resources_search/serializers.py index 7b89849270..23f5b1f5d4 100644 --- a/learning_resources_search/serializers.py +++ b/learning_resources_search/serializers.py @@ -259,6 +259,12 @@ class SearchRequestSerializer(serializers.Serializer): child=serializers.CharField(), help_text="The topic name. To see a list of options go to api/v1/topics/", ) + dev_mode = serializers.BooleanField( + required=False, + allow_null=True, + default=False, + help_text="If true return raw open search results with score explanations", + ) def validate(self, attrs): unknown = set(self.initial_data) - set(self.fields) diff --git a/learning_resources_search/serializers_test.py b/learning_resources_search/serializers_test.py index 7d32686772..c1ad5eaaa2 100644 --- a/learning_resources_search/serializers_test.py +++ b/learning_resources_search/serializers_test.py @@ -831,6 +831,7 @@ def test_learning_resources_search_request_serializer(): "course_feature": ["Lecture Videos"], "aggregations": ["resource_type", "platform", "level", "resource_category"], "yearly_decay_percent": 0.25, + "dev_mode": False, } serialized = LearningResourcesSearchRequestSerializer(data=data) @@ -867,6 +868,7 @@ def test_content_file_search_request_serializer(): "resource_id": [1, 2, 3], "offered_by": ["xpro", "ocw"], "platform": ["xpro", "edx", "ocw"], + "dev_mode": False, } serialized = ContentFileSearchRequestSerializer(data=data) diff --git a/learning_resources_search/views.py b/learning_resources_search/views.py index a7711e1c27..be9aa8219c 100644 --- a/learning_resources_search/views.py +++ b/learning_resources_search/views.py @@ -71,11 +71,15 @@ def get(self, request): response = execute_learn_search( request_data.data | {"endpoint": LEARNING_RESOURCE} ) - return Response( - LearningResourcesSearchResponseSerializer( - response, context={"request": request} - ).data - ) + + if request_data.data.get("dev_mode"): + return Response(response) + else: + return Response( + LearningResourcesSearchResponseSerializer( + response, context={"request": request} + ).data + ) else: errors = {} for key, errors_obj in request_data.errors.items(): @@ -237,11 +241,14 @@ def get(self, request): response = execute_learn_search( request_data.data | {"endpoint": CONTENT_FILE_TYPE} ) - return Response( - ContentFileSearchResponseSerializer( - response, context={"request": request} - ).data - ) + if request_data.data.get("dev_mode"): + return Response(response) + else: + return Response( + LearningResourcesSearchResponseSerializer( + response, context={"request": request} + ).data + ) else: errors = {} for key, errors_obj in request_data.errors.items(): diff --git a/openapi/specs/v1.yaml b/openapi/specs/v1.yaml index adeeaba92e..9b94023551 100644 --- a/openapi/specs/v1.yaml +++ b/openapi/specs/v1.yaml @@ -156,6 +156,13 @@ paths: minLength: 1 description: The feature type of the content file. Possible options are at api/v1/course_features/ + - in: query + name: dev_mode + schema: + type: boolean + nullable: true + default: false + description: If true return raw open search results with score explanations - in: query name: id schema: @@ -2298,6 +2305,13 @@ paths: \ Society\n* `MAS` - Media Arts and Sciences\n* `PE` - Athletics, Physical\ \ Education and Recreation\n* `RES` - Supplemental Resources\n* `STS` -\ \ Science, Technology, and Society\n* `WGS` - Women's and Gender Studies" + - in: query + name: dev_mode + schema: + type: boolean + nullable: true + default: false + description: If true return raw open search results with score explanations - in: query name: free schema: @@ -2728,6 +2742,13 @@ paths: \ Society\n* `MAS` - Media Arts and Sciences\n* `PE` - Athletics, Physical\ \ Education and Recreation\n* `RES` - Supplemental Resources\n* `STS` -\ \ Science, Technology, and Society\n* `WGS` - Women's and Gender Studies" + - in: query + name: dev_mode + schema: + type: boolean + nullable: true + default: false + description: If true return raw open search results with score explanations - in: query name: free schema: @@ -3183,6 +3204,13 @@ paths: \ Society\n* `MAS` - Media Arts and Sciences\n* `PE` - Athletics, Physical\ \ Education and Recreation\n* `RES` - Supplemental Resources\n* `STS` -\ \ Science, Technology, and Society\n* `WGS` - Women's and Gender Studies" + - in: query + name: dev_mode + schema: + type: boolean + nullable: true + default: false + description: If true return raw open search results with score explanations - in: query name: free schema: @@ -3629,6 +3657,13 @@ paths: \ Society\n* `MAS` - Media Arts and Sciences\n* `PE` - Athletics, Physical\ \ Education and Recreation\n* `RES` - Supplemental Resources\n* `STS` -\ \ Science, Technology, and Society\n* `WGS` - Women's and Gender Studies" + - in: query + name: dev_mode + schema: + type: boolean + nullable: true + default: false + description: If true return raw open search results with score explanations - in: query name: free schema: @@ -9500,6 +9535,11 @@ components: type: string minLength: 1 description: The topic name. To see a list of options go to api/v1/topics/ + dev_mode: + type: boolean + nullable: true + default: false + description: If true return raw open search results with score explanations id: type: array items: