Commit 5106f5b4 authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Generaliza agregaciones y campos, unifica activity

Estrena nuevas secciones de configuración en redmicConfig, dedicadas a
contener las agregaciones de filtrado rápido (Facets) y los campos que
se desean que sean devueltos en las consultas, indexadas por servicio
(por ahora, sólo activity).

Aprovecha las nuevas estructuras para sincronizar el comportamiento del
buscador inicial con el del catálogo de actividades, ofreciendo los
mismos facets y campos devueltos.
parent 6b9410db
Loading
Loading
Loading
Loading
+4 −16
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@ define([
	, 'app/base/views/extensions/_AddCompositeSearchInTooltipFromTextSearch'
	, "app/designs/textSearchFacetsList/Controller"
	, "app/designs/textSearchFacetsList/Layout"
	, 'app/redmicConfig'
	, "dojo/_base/declare"
	, "dojo/_base/lang"
	, "templates/ActivityList"
@@ -15,6 +16,7 @@ define([
	, _AddComposite
	, Controller
	, Layout
	, redmicConfig
	, declare
	, lang
	, templateList
@@ -43,7 +45,7 @@ define([

			this.filterConfig = this._merge([{
				initQuery: {
					returnFields: ['id', 'name', 'code', 'endDate', 'activityType', 'activityCategory']
					returnFields: redmicConfig.returnFields.activity
				}
			}, this.filterConfig || {}]);

@@ -70,21 +72,7 @@ define([
			}, this.browserConfig || {}]);

			this.facetsConfig = this._merge([{
				aggs: {
					"activityType": {
						"open": true,
						"terms": {
							"field": "activityType.name",
							"size": 100
						}
					},
					"territorialScope": {
						"terms": {
							"field": "scope.name",
							"size": 20
						}
					}
				}
				aggs: redmicConfig.aggregations.activity
			}, this.facetsConfig || {}]);
		}
	});
+6 −1
Original line number Diff line number Diff line
@@ -37,7 +37,12 @@ define([
					'TOGGLE_ADVANCED_SEARCH': 'toggleAdvancedSearch'
				},
				target: redmicConfig.services.activity,
				'class': 'searchBarPanel'
				'class': 'searchBarPanel',
				filterConfig: {
					initQuery: {
						returnFields: redmicConfig.returnFields.activity
					}
				}
			};

			lang.mixin(this, this.config, args);
+8 −19
Original line number Diff line number Diff line
define([
	'dojo/_base/declare'
	'app/redmicConfig'
	, 'dojo/_base/declare'
	, 'dojo/_base/lang'
	, 'redmic/modules/base/_Module'
	, 'redmic/modules/base/_Show'
	, 'redmic/modules/search/FacetsImpl'
], function(
	declare
	redmicConfig
	, declare
	, lang
	, _Module
	, _Show
@@ -30,23 +32,10 @@ define([

			this.facetsSearchConfig = this._merge([{
				parentChannel: this.getChannel(),
				aggs: {
					themeInspire: {
						"open": true,
						"terms": {
							"field": "themeInspire.name"
						}
					},
					"activityType": {
						"terms": {
							"field": "activityType.name"
						}
					},
					"territorialScope": {
						"terms": {
							"field": "scope.name"
						}
					}
				aggs: redmicConfig.aggregations.activity,
				query: {
					returnFields: redmicConfig.returnFields.activity

				}
			}, this.facetsSearchConfig || {}]);

+26 −0
Original line number Diff line number Diff line
@@ -336,6 +336,32 @@ define([], function() {
		//	***********************************************************************************
	};

	retObj.aggregations = {
		activity: {
			themeInspire: {
				open: true,
				terms: {
					field: 'themeInspire.name'
				}
			},
			activityType: {
				terms: {
					field: 'activityType.name'
				}
			},
			territorialScope: {
				terms: {
					field: 'scope.name'
				}
			}
		}
	};

	retObj.returnFields = {
		activity: ['accessibility', 'activityCategory', 'activityType', 'code', 'endDate', 'id', 'name', 'starred',
			'startDate', 'themeInspire']
	};

	retObj.outerPaths = [
		'login',
		'register',