在 Solr 中编辑哪个 schema.xml 文件?

Which schema.xml file edit in Solr?

我从这里下载了一个 Solr 包:http://lucene.apache.org/solr/mirrors-solr-latest-redir.html

我想在 schema.xml 文件中创建一个新字段,但我不知道在哪个文件中 - 下载的文件夹中有 7 schema.xml 个文件。

我编辑了所有这些文件,但没有任何改变。

我应该在哪里添加新的字段定义?

如果您有标准发行版 (http://lucene.apache.org/solr/mirrors-solr-latest-redir.html),您可以在 solr-5.2.1/server/solr

找到您的内核

您可能面临的一个问题是您还没有定义任何内核。如果是这种情况,请将 solr-5.2.1\server\solr\configsets\basic_configs 复制到 solr-5.2.1\server\solr\my_new_core(重命名文件夹)- 恭喜,您定义了一个新核心。

现在 运行 服务器:运行 在命令行 solr-5.2.1\bin\solr 中使用参数启动。在浏览器中打开:http://localhost:8983/solr/#/~cores/example_core 并使用 instanceDir = my_new_core 添加核心。这会初始化您的核心 - 使其功能齐全。

现在你可以找到solr-5.2.1\server\solr\example_core\conf\solrconfig.xml 并按照您的意愿进行配置。更改后 solrconfig.xml 记得在 Core Admin 重新加载核心。

通过运行命令提示符下的命令创建一个 solr 实例 solr create -c test 这里测试是集合 name.Copy schema.xml 和 solrconfig.xml 从 techproducts 项目文件夹到测试的 conf 文件夹 project.Now 你可以在 schema.xml 中定义你的模式。