DSS has two sides to it. One is the process in which the data is pooled into ElasticSearch and the other is the way it is fetched, aggregated, computed, transformed and sent across.
As this revolves around various data sets, there is a need to make this configurable. This ensures that the process can be configured easily in case a new scenario is introduced. This document explains the steps on how to define the configurations for the analytics side of DSS for W&S.
In this, Visualization Code, which happens to be the key, will be having its properties configured as a part of the configuration and are easily changeable.
Copy "nurtProjectStatus": {
"chartName": "NURT_PROJECT_STAUS",
"queries": [
{
"module": "COMMON",
"requestQueryMap": "{\"state\" : \"state.keyword\",\"ulb\" : \"ulb.keyword\"}",
"dateRefField": "date",
"indexName": "common-national-dashboard",
"aggrQuery": "{\"size\":0,\"query\":{\"bool\":{\"adjust_pure_negative\":true,\"boost\":1}},\"aggs\":{\"states\":{\"terms\":{\"field\":\"state.keyword\"},\"aggs\":{\"latest\":{\"terms\":{\"field\":\"date\",\"order\":{\"_term\":\"desc\"},\"size\":1},\"aggs\":{\"Status\":{\"terms\":{\"field\":\"status.keyword\"}},\"totalUlbs\":{\"avg\":{\"field\":\"totalUlbCount\"}},\"liveUlbs\":{\"avg\":{\"field\":\"totalLiveUlbsCount\"}}}}}}}}"
}
],
"isMdmsEnabled": false,
"isPostResponseHandler": true,
"chartType": "table",
"valueType": "number",
"drillChart": "nurtProjectStatusModule",
"drillFields": [
"states"
],
"documentType": "_doc",
"action": "",
"aggregationPaths": [
"states",
"Status",
"totalUlbs",
"liveUlbs"
],
"plotLabel": "states",
"pathDataTypeMapping": [
{
"states": "string"
},
{
"Status": "string"
},
{
"totalUlbs": "number"
},
{
"liveUlbs": "number"
}
],
"insight": {
},
"_comment": ""
},
"nurtProjectStatusModule": {
"chartName": "NURT_PROJECT_STAUS",
"queries": [
{
"module": "COMMON",
"requestQueryMap": "{\"state\" : \"state.keyword\",\"ulb\" : \"ulb.keyword\"}",
"dateRefField": "date",
"indexName": "common-national-dashboard",
"aggrQuery": "{\"size\":0,\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must\":[{\"term\":{\"status.keyword\":\"Live\"}},{\"range\":{\"liveUlbsCountForServiceModuleCode\":{\"gte\":1}}}]}},\"aggs\":{\"module\":{\"terms\":{\"field\":\"serviceModuleCode.keyword\"},\"aggs\":{\"latest\":{\"terms\":{\"field\":\"date\",\"order\":{\"_term\":\"desc\"},\"size\":1},\"aggs\":{\"liveUlbPerModule\":{\"avg\":{\"field\":\"liveUlbsCountForServiceModuleCode\"}}}}}},\"totalLiveUlbCount\":{\"avg\":{\"field\":\"totalLiveUlbsCount\"}}}}}}"
}
],
"isMdmsEnabled": false,
"isPostResponseHandler": true,
"chartType": "table",
"valueType": "number",
"drillChart": "none",
"documentType": "_doc",
"action": "",
"aggregationPaths": [
"module",
"liveUlbPerModule"
],
"plotLabel": "module",
"pathDataTypeMapping": [
{
"module": "string"
},
{
"liveUlbPerModule": "number"
}
],
"insight": {
},
"_comment": ""
},
"nurtliveOnboardedUlbs": {
"chartName": "NURT_LIVE_ACTIVE_ULBS",
"queries": [
{
"module": "COMMON",
"requestQueryMap": "{\"state\" : \"state.keyword\",\"ulb\" : \"ulb.keyword\"}",
"dateRefField": "date",
"indexName": "common-national-dashboard",
"aggrQuery": "{\"size\":0,\"query\":{\"bool\":{\"adjust_pure_negative\":true,\"boost\":1}},\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{}},\"aggs\":{\"onBoardeUlbsCount\":{\"date_histogram\":{\"field\":\"date\",\"interval\":\"intervalvalue\"},\"aggs\":{\"latest\":{\"terms\":{\"field\":\"date\",\"order\":{\"_term\":\"desc\"},\"size\":1},\"aggs\":{\"onBoardeUlbsCount\":{\"avg\":{\"field\":\"onboardedUlbsCount\"}}}},\"onBoardeUlbsCount\":{\"sum_bucket\":{\"buckets_path\":\"latest.onBoardeUlbsCount\"}}}},\"liveUlbsCount\":{\"filter\":{\"bool\":{\"must\":[{\"term\":{\"status.keyword\":\"Live\"}},{\"range\":{\"liveUlbsCountForServiceModuleCode\":{\"gte\":1}}}]}},\"aggs\":{\"test\":{\"date_histogram\":{\"field\":\"date\",\"interval\":\"intervalvalue\"},\"aggs\":{\"latest\":{\"terms\":{\"field\":\"date\",\"order\":{\"_term\":\"desc\"},\"size\":1},\"aggs\":{\"LiveUlbCount\":{\"avg\":{\"field\":\"totalLiveUlbsCount\"}}}},\"liveUlbsCount\":{\"sum_bucket\":{\"buckets_path\":\"latest.LiveUlbCount\"}}}}}}}}}}"
}
],
"chartType": "line",
"valueType": "number",
"action": "",
"drillChart": "none",
"documentType": "_doc",
"aggregationPaths": [
"onBoardeUlbsCount",
"liveUlbsCount"
],
"isCumulative": false,
"interval": "month",
"insight": {},
"_comment": " "
},
"nurtOnboardedStates":{
"chartName": "NURT_ONBOARDED_STATES",
"queries": [
{
"module": "COMMON",
"dateRefField": "date",
"requestQueryMap": "{\"state\" : \"state.keyword\",\"ulb\" : \"ulb.keyword\"}",
"indexName": "common-national-dashboard",
"aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"match\":{\"status\":\"OnBoarded\"}},\"aggs\":{\"OnBoardedStates\":{\"cardinality\":{\"field\":\"state.keyword\"}}}}}}"
}
],
"chartType": "metric",
"valueType": "number",
"drillChart": "none",
"documentType": "_doc",
"action": "",
"aggregationPaths": [
"OnBoardedStates"
],
"insight": {
},
"_comment": " "
},
"nurtUnderImpStates":{
"chartName": "NURT_UNDERIMPL_STATES",
"queries": [
{
"module": "COMMON",
"dateRefField": "date",
"requestQueryMap": "{\"state\" : \"state.keyword\",\"ulb\" : \"ulb.keyword\"}",
"indexName": "common-national-dashboard",
"aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"match\":{\"status\":\"UnderImplementation\"}},\"aggs\":{\"underImpmStates\":{\"cardinality\":{\"field\":\"state.keyword\"}}}}}}"
}
],
"chartType": "metric",
"valueType": "number",
"drillChart": "none",
"documentType": "_doc",
"action": "",
"aggregationPaths": [
"underImpmStates"
],
"insight": {
},
"_comment": " "
},
"nurtLiveStates":{
"chartName": "NURT_LIVE_STATES",
"queries": [
{
"module": "COMMON",
"dateRefField": "date",
"requestQueryMap": "{\"state\" : \"state.keyword\",\"ulb\" : \"ulb.keyword\"}",
"indexName": "common-national-dashboard",
"aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"match\":{\"status\":\"Live\"}},\"aggs\":{\"liveStates\":{\"cardinality\":{\"field\":\"state.keyword\"}}}}}}"
}
],
"chartType": "metric",
"valueType": "number",
"drillChart": "none",
"documentType": "_doc",
"action": "",
"aggregationPaths": [
"liveStates"
],
"insight": {
},
"_comment": " "
},
"nurtLiveUlbs":{
"chartName": "NURT_LIVE_ULB",
"queries": [
{
"module": "COMMON",
"dateRefField": "date",
"requestQueryMap": "{\"state\" : \"state.keyword\",\"ulb\" : \"ulb.keyword\"}",
"indexName": "common-national-dashboard",
"aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must\":[{\"term\":{\"status.keyword\":\"Live\"}},{\"range\":{\"liveUlbsCountForServiceModuleCode\":{\"gte\":1}}}]}},\"aggs\":{\"latest\":{\"terms\":{\"field\":\"date\",\"order\":{\"_term\":\"desc\"},\"size\":1},\"aggs\":{\"modules\":{\"terms\":{\"field\":\"serviceModuleCode.keyword\"},\"aggs\":{\"intermediateAggr\":{\"avg\":{\"field\":\"liveUlbsCountForServiceModuleCode\"}}}},\"LiveUlbCount\":{\"avg\":{\"field\":\"totalLiveUlbsCount\"}}}},\"totalLiveUlbCount\":{\"avg_bucket\":{\"buckets_path\":\"latest.LiveUlbCount\"}}}}}}"
}
],
"chartType": "metric",
"valueType": "number",
"drillChart": "none",
"documentType": "_doc",
"action": "",
"aggregationPaths": [
"totalLiveUlbCount"
],
"insight": {
},
"_comment": " "
},
"nurtTotalCitzens":{
"chartName": "NURT_TOTAL_CITIZENS",
"queries": [
{
"module": "COMMON",
"dateRefField": "date",
"requestQueryMap": "{\"state\" : \"state.keyword\",\"ulb\" : \"ulb.keyword\"}",