diff --git a/client/application.js b/client/application.js
index fcbcdc3..5a2ee8a 100644
--- a/client/application.js
+++ b/client/application.js
@@ -17,8 +17,8 @@
$.getJSON('/node/search', params, function(results) {
var hintData = {};
- for (var feature in results.columns) {
- hintData[feature] = results.columns[feature].hints;
+ for (var keyword in results.columns) {
+ hintData[keyword] = results.columns[keyword].hints;
}
ctx.grapher.setColumnHints(hintData);
@@ -28,7 +28,7 @@
function onSearch() {
var params = {
- keyword: $('#keyword').val(),
+ keywords: $('#keywords').val(),
searchRange: { min: -1.0, max: 1.0 },
minScore: parseInt($('#minScore').val()),
hintSteps: parseInt($('#hintSteps').val()),
@@ -73,24 +73,28 @@
$('#results').append(template({'results': results}));
}
- $(document).ready(function() {
- $(document).on({
- ajaxStart: function() {
- $('#spinner').show();
- },
- ajaxStop: function() {
- $('#spinner').hide();
- }
- });
+ $(document).on({
+ ajaxStart: function() {
+ $('#spinner').show();
+ },
- $.getJSON('/node/keywords', function(keywords) {
- for (var i = 0; i < keywords.length; ++i) {
- var properties = { value: keywords[i], text: keywords[i] };
- $('#keyword').append($('', properties));
- }
+ ajaxStop: function() {
+ $('#spinner').hide();
+ },
- $('#search').prop('disabled', false);
- $('#search').click(onSearch);
- });
+ ready: function() {
+ $.getJSON('/node/keywords', function(keywords) {
+ for (var i = 0, count = keywords.length; i < count; ++i) {
+ $('#keywords').append($('', {
+ value: keywords[i],
+ text: keywords[i]
+ }));
+ }
+
+ $('#search').prop('disabled', false);
+ $('#search').click(onSearch);
+ });
+ }
});
+
}(window.hscd = window.hscd || {}));
diff --git a/server/db/search.js b/server/db/search.js
index 5df272b..f6bc7f5 100644
--- a/server/db/search.js
+++ b/server/db/search.js
@@ -118,6 +118,8 @@ module.exports.execQuery = function(query) {
var searchResults = null;
if (!searchParams) {
+ searchParams = {};
+
for (var i = 0, count = query.keywords.length; i < count; ++i) {
var keyword = query.keywords[i];
if (_.has(db_keywords, keyword)) {
@@ -142,7 +144,7 @@ module.exports.execQuery = function(query) {
query.hintSteps
);
- graphColumns[param.name] = {
+ graphColumns[keyword] = {
color: '#607080',
value: searchParams[keyword],
hints: searchHints,