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

查看:197
本文介绍了架构浏览器不显示我在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:\ tomcat-solr \ server \ solr \ Core3 \ conf"文件夹时,没有找到schema.xml,因此我从文件夹"\ solr-5.1.0 \"复制了schema.xml文件.服务器\ solr \ configsets \ basic_configs \ conf".

When I went and see in "C:\tomcat-solr\server\solr\Core3\conf" folder I did not find schema.xml so I copied schema.xml file from folder "\solr-5.1.0\server\solr\configsets\basic_configs\conf".

我在下面添加了字段.

 <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,并试图在Admin 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,它表示将<schemaFactory>设置为...

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.

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

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