What is the default address of Solr Server (Solr 4

2020-04-03 12:25发布

I'm trying to connect with Solr Server from a SolrJ client, but it gives an HTTPResponse Exception.

Here's my code:

SolrServer server = new HttpSolrServer("http://"localhost":8983/solr/");

Here's the exception:

java.lang.NoClassDefFoundError: org/apache/http/NoHttpResponseException:

Does Solr have a default address? Where can you find it?

标签: solr solrj
2条回答
可以哭但决不认输i
2楼-- · 2020-04-03 13:22

I am not familiar with SolrJ - but the endpoint seems to be missing the core name to me.

You would need to point your Solr client to a particular core.

The URI for the core would look like this (for reloading core command)

http://localhost:8983/solr/{{solrCoreName}}

The admin UI should be accessible at

http://localhost:8983/solr
查看更多
姐就是有狂的资本
3楼-- · 2020-04-03 13:29

By default, Solr will start on port 8983. That can be changed though. You can change that for example in the solr.in.sh file using the SOLR_PORT property.

查看更多
登录 后发表回答