如何获得拼写检查响应json solr

时间:2015-10-26 16:45:39

标签: jquery json solr

URL ==>> http://localhost:8080/solr/Test/suggest?indent=true&wt=json&q=how

{
  "responseHeader":{
    "status":0,
    "QTime":2},
  "spellcheck":{
    "suggestions":[
      "how",{
        "numFound":5,
        "startOffset":0,
        "endOffset":3,
        "suggestion":["how to tie a tie",
          "how to get away with a murderer",
          "how to boil eggs",
          "how to lose weight",
          "how to make money"]}]}}

我越过json格式,如何使用jquery

获取此响应

1 个答案:

答案 0 :(得分:0)

我得到了答案,我正在寻找这个解决方案  $就({                   url:" lmPerm",                   dataType:" json",                   成功:函数(数据){  var suggestions =(data.spellcheck.suggestions&& data.spellcheck.suggestions.length> 1)? data.spellcheck.suggestions [1] .suggestion:[];                       for(var d = 0; d< suggestions.length; d ++){                           var doc = suggestions [d];

                  }

所有建议值都来自doc变量