diff --git a/src/main/webapp/js/index.js b/src/main/webapp/js/index.js index 5caa745dc122e2dd8772771d4436b5fa0c0774b7..8fa37aa300ae3dd4826d4f4eb59f8a42f17a0cd1 100644 --- a/src/main/webapp/js/index.js +++ b/src/main/webapp/js/index.js @@ -20,8 +20,8 @@ $(function(){ $('#contentQuery').suggestor( { ajaxinfo: { - url: contextPath + '/json', - fn: 'content', + url: contextPath + '/suggest', // TODO rename + fn: 'keyword', num: 10 }, boxCssInfo: { diff --git a/src/main/webapp/js/suggestor.js b/src/main/webapp/js/suggestor.js index e914e2bdb90a9196a5ffcab3e289f2b5e7e8bc15..455d89cc08f91e46d0b5153759bc577a62da66e5 100644 --- a/src/main/webapp/js/suggestor.js +++ b/src/main/webapp/js/suggestor.js @@ -102,9 +102,8 @@ $.fn.suggestor = function(setting) { type:"get", dataType: "jsonp", cache : false, - data:{ query: $textArea.val(), - type: "suggest", - fn: settingAjaxInfo.fn, + data:{ q: $textArea.val(), + fields: settingAjaxInfo.fn, num: settingAjaxInfo.num * 2 } }).done(function(obj) { suggestor.createAutoCompleteList(obj); }).fail(function(a,obj,b) { suggestingSts=false; return; }); @@ -113,19 +112,16 @@ $.fn.suggestor = function(setting) { createAutoCompleteList: function(obj) { - var response = obj.response; + var hits = obj.hits; var suggestor = this; var addCount = 0; listNum = 0; - if(typeof response.result !== "undefined") { + if(typeof hits !== "undefined") { var reslist = new Array(); - for(var i=0;i"); $olEle.css("list-style","none");