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

查看:29
本文介绍了Schema Browser 不显示我在 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 文件服务器solrconfigsetsasic_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

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

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

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

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