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
获取此响应答案 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变量