开发者

solr wont work with jquery

开发者_StackOverflow中文版When I enter 'http://localhost:8983/solr/select/?q=body:hello` in the URL field I get all the correct results.

but when I'm using jquery code:

$.post(http://localhost:8983/solr/select/?q=body:hello, function(data){
       alert(data);
});

OR

$.post('http://localhost:8983/solr/select/?, {q: 'body:hello'}, function(data){
       alert(data);
});

I get nothing. it doesn't give me anything. not even an alert.

I have tried $.get as well without result.

what could the problem be and what is best practice for using solr with ajax?


You should use $.getJSON and the JSON response writer (wt=json in your querystring).

Also take a look at the ajax-solr project.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜