tags:

views:

152

answers:

1

When I enter 'http://localhost:8983/solr/select/?q=body%3Ahello` 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?

+1  A: 

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

Also take a look at the ajax-solr project.

Mauricio Scheffer
should i use jquery or php to get data from solr? which one is the best solution and why?
weng
that's a whole other question which you have already posted: http://stackoverflow.com/questions/1900474/php-of-jquery-to-access-solr
Mauricio Scheffer