Issues with running my Apache Solr project:

160 Views Asked by At

I'm trying to set up Apache Solr and run some experiments. I've set up the Solr search engine on my Ubuntu 18.04, indexed a few files, and it works perfectly given a specific query. The admin page is accessible on the default port on localhost:8983/solr

Now I was trying to setup a web-based client communicating with Solr. I found this simple project located at Google Code here. I extracted it, and follow the simple instructions to make the contents available via localhost http (using python -m http.server). So when I go to http://localhost:8000, I see the index.html client. Apparently the only thing we need to check for integration is js/solr-search.js file to make sure the solrURL is set correctly, which the default is good already:

var solrUrl = 'http://' + document.location.hostname + ':8983/solr/';

But when I try to press the search button, it doesn't show any results and the loading icon keeps showing:

Apache solr html client

Where is the problem? How can I fix the issue?

UPDATE: I debugged and noticed this error on index.html:

Failed to load http://localhost:8983/solr/admin/cores?wt=json: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8000' is therefore not allowed access.

0

There are 0 best solutions below