架构浏览器不显示我在 Solr 中添加到 schema.xml 中的字段 [英] Schema Browser does not show fields added in schema.xml by me in Solr

查看:22
本文介绍了架构浏览器不显示我在 Solr 中添加到 schema.xml 中的字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 solr v5.1 中创建的名为Core3"的核心的 schema.xml 中添加了一些字段.我不是指示例文件夹,而是使用服务器"文件夹来运行 solr 服务器并创建 solr 核心.

I have added some fields in schema.xml of core named "Core3" created by me in solr v5.1. I am not referring to examples folder but using "server" folder to run solr server and to create solr cores.

我使用 bin 文件夹中提供的solr create"实用程序创建了内核.

I have created cores using "solr create" utility provided in bin folder.

我使用命令创建了代号Core3",

I have created code name "Core3" using command,

solr create -c Core3

当我在C: omcat-solrserversolrCore3conf"文件夹中看到时,我没有找到schema.xml,所以我从文件夹solr-5.1.0"中复制了schema.xml文件serversolrconfigsetsasic_configsconf".

When I went and see in "C: omcat-solrserversolrCore3conf" folder I did not find schema.xml so I copied schema.xml file from folder "solr-5.1.0serversolrconfigsetsasic_configsconf".

我添加了以下字段.

 <field name="courseid" type="string" indexed="true" stored="true" required="true" multiValued="false" />   
   <field name="coursetitle" type="string" indexed="true" stored="true" multiValued="false"/>    
   <field name="durationinseconds" type="int" indexed="true" stored="true" />   
   <field name="releasedate" type="date" indexed="true" stored="true"/>

在那之后,我停止并启动了 solr 托管的 apache tomcat,并尝试在管理 UI 的架构浏览器"中查看新字段,但这些字段不存在.请帮助我解释为什么字段不显示的原因?

After that I have stopped and started apache tomcat on which solr hosted and tried to see new fields in "Schema Browser" in Admin UI but these fields were not there. Kindly help me with reason why fields are not showing?

推荐答案

在内核目录下 conf 文件夹中的 solrconfig.xml 文件中.有一种方法可以为该核心定义使用托管架构或 schema.xml

In the solrconfig.xml file in the conf folder located in the directory for your core. There is a way to define using a managed-schema or schema.xml for that core

要使用 schema.xml,它说将 设置为...

To use schema.xml it says to set <schemaFactory> to...

<schemaFactory class="ClassicIndexSchemaFactory"/>

要使用托管架构文件,这似乎是您以这种方式创建新核心时的默认设置(此文件不应手动编辑,而是使用动态架构 REST API 以编程方式对其进行编辑)将其设置为...

To use the managed-schema file, which seems to be the default when you create a new core in this way (this file is not supposed to be hand edited but rather use the dynamic schema REST API to programmatically edit it) you would set it to...

<schemaFactory class="ManagedIndexSchemaFactory">
  <bool name="mutable">true</bool>
  <str name="managedSchemaResourceName">managed-schema</str>
</schemaFactory>

可以在此处找到有关此内容的更多信息...https://cwiki.apache.org/confluence/display/solr/Managed+Schema+Definition+in+SolrConfig

More on this can be found here... https://cwiki.apache.org/confluence/display/solr/Managed+Schema+Definition+in+SolrConfig

或者在 solrconfig.xml 文件中 schemaFactory 部分附近有说明.

Or there is explanation in the solrconfig.xml file itself near the schemaFactory section.

这篇关于架构浏览器不显示我在 Solr 中添加到 schema.xml 中的字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆