<commit_before>var data = require('../data/sampleData');
var mongodb = require('../data/mongodb');
var indicator = require('../data/indicator');
var dataset = require('../data/dataset');
var analysis = require('../data/analysis');
var async = require('../lib/async');
var hashids = require('../lib/hashids');
var IndicatorSchema = indicator.Indicator;
var datasetSchema = dataset.Dataset;
var analysisSchema = analysis.Analysis;

exports.cubeList = function(req, res) {
	res.send(data.cubeListJSON);
};

exports.cubeInfo = function(req, res) {
	res.send(data.cubeInfoJSON);
};

exports.topicSearch = function(req, res) {
	var resultJSON = [];
	var mainTopic = '';
	var indicatorText = [];
	/*IndicatorSchema.aggregate().group({
		'_id' : '$topic'
	}).project({
		'topic' : '$_id'*/
		IndicatorSchema.find({},{_id:0,topic:1,indicator_text:1
	}).sort({
		'topic' : 1
	}).exec(function(err, doc) {
		// .match({'topic' : 'Education: Efficiency'})
		// IndicatorSchema.find().select({'topic' : 1, '_id' :
		// 0}).sort({'topic':1}).exec(function(err, doc) {
		// IndicatorSchema.distinct('topic').sort().exec(function(err, doc) {
		if (err)
			console.log('Exception: ' + err);
		doc.forEach(function(item, index) {
			if (item.topic === null)
				return;<commit_msg>minor fix for topic search<commit_after>var data = require('../data/sampleData');
var mongodb = require('../data/mongodb');
var indicator = require('../data/indicator');
var dataset = require('../data/dataset');
var analysis = require('../data/analysis');
var async = require('../lib/async');
var hashids = require('../lib/hashids');
var IndicatorSchema = indicator.Indicator;
var datasetSchema = dataset.Dataset;
var analysisSchema = analysis.Analysis;

exports.cubeList = function(req, res) {
	res.send(data.cubeListJSON);
};

exports.cubeInfo = function(req, res) {
	res.send(data.cubeInfoJSON);
};

exports.topicSearch = function(req, res) {
	var resultJSON = [];
	var mainTopic = '';
	var indicatorText = [];
	/*IndicatorSchema.aggregate().group({
		'_id' : '$topic'
	}).project({
		'topic' : '$_id'*/
		IndicatorSchema.find({},{_id:0,topic:1,indicator_text:1
	}).sort({
		'topic' : 1
	}).exec(function(err, doc) {
		// .match({'topic' : 'Education: Efficiency'})
		// IndicatorSchema.find().select({'topic' : 1, '_id' :
		// 0}).sort({'topic':1}).exec(function(err, doc) {
		// IndicatorSchema.distinct('topic').sort().exec(function(err, doc) {
		if (err)
			console.log('Exception: ' + err);
		doc.forEach(function(item, index) {
			if (item.topic == null)
				return;
{'fraction_non_alphanumeric': 0.20843183609141056, 'fraction_numerical': 0.005516154452324665, 'mean_word_length': 4.555798687089715, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3586163', 'n_tokens_mistral': 902, 'n_tokens_neox': 857, 'n_words': 161}