java - SOLR:没有可用的核心

标签 java solr

尝试通过java连接到我的本地solr服务器5.4.0

public class Test {
public static void main(String[] args) throws SolrServerException, IOException{

//  ArrayList<String> sellers = Util.readFile("sellersBP.csv", true);

    SolrClient solr = new HttpSolrClient("http://localhost:8983/solr/#/techproducts/");
     QueryResponse resp = solr.query("techproducts",new SolrQuery("*:*"));

}
}

但是,我收到一条错误消息,其中包含一堆 HTML 标记,并在其中显示。 Exception in thread "main" org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error from server at <a href="http://localhost:8983/solr/#/techproducts" rel="noreferrer noopener nofollow">http://localhost:8983/solr/#/techproducts</a>: Expected mime type application/octet-stream but got text/html.

<p> No cores available Go and create one </p>

这很奇怪,因为我使用的是示例 solr 示例,它在我的 UI 中创建了一个名为 techproducts 的核心。有什么建议吗?

Solr UI

网址

enter image description here

最佳答案

URL http://localhost:8983/solr/#/techproducts/ 具有本地 anchor (# 后面的所有内容),该 anchor 仅适用于浏览器本身(它永远不会发送到服务器)。管理 UI 中的 JavaScript 使用它来从正确的核心检索信息。

用于访问核心的实际 URL 为http://localhost:8983/solr/techproducts/

关于java - SOLR:没有可用的核心,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34830860/

相关文章:

mysql - Solr 4.10.2 MySQL 导入失败并出现 java.io.EOFException

ruby-on-rails - Solr 在一个单独的 docker 容器上,带有 sunspot-rails

java - Spring/Spring Boot 转换 - 如何在 Converters 上建立链?

java - 我可以用 sun.misc.Unsafe 覆盖对象吗?

java - 我可以在查询参数中使用 Map<> 吗?

java - 如何从ActionBean访问父目录?

java - Solr:支持希腊语的音译/转录

java - 如何在数组中查找大于、小于或等于某个值的数字?

solr - 没有 Zookeeper 的独立 Solr 的安全选项

solr - 在 solr 1.4 中突出显示时显示所有出现的查询