开发者

solr responses to webbrowser URL but not from javascript code?

开发者 https://www.devze.com 2022-12-14 05:11 出处:网络
I have set up Solr and it\'s working because I can see the search results when I\'m typing: http://localhost:8983/so开发者_开发知识库lr/select?q=*:*

I have set up Solr and it's working because I can see the search results when I'm typing:

http://localhost:8983/so开发者_开发知识库lr/select?q=*:*

in the browser.

However, it doesn't work when I try to contact it through ajax-javascript/jquery.

I've tried with $.get, $.post and with the ajax-solr code:

var Manager;
(function ($) {

  $(function () {
    Manager = new AjaxSolr.Manager({
      solrUrl: 'http://localhost:8983/solr/select'
    });
    Manager.init();
    Manager.store.addByValue('q', '*:*');
    Manager.doRequest();
  });

})(jQuery);

I get no response when I'm checking with firebug.

How comes?


If you are using the most recent version of ajax-solr, you must remove the trailing "select":

var Manager;
(function ($) {

  $(function () {
    Manager = new AjaxSolr.Manager({
      solrUrl: 'http://localhost:8983/solr/'
    });
    Manager.init();
    Manager.store.addByValue('q', '*:*');
    Manager.doRequest();
  });

})(jQuery);

This change was made as some users needed to be able to contact multiple request handlers.

0

精彩评论

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