【问题标题】:Schema Browser does not show fields added in schema.xml by me in Solr模式浏览器不显示我在 Solr 中添加到 schema.xml 中的字段
【发布时间】:2015-07-10 01:38:03
【问题描述】:

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

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

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

solr create -c Core3

当我在“C:\tomcat-solr\server\solr\Core3\conf”文件夹中查看时,我没有找到 schema.xml,所以我从文件夹“\solr-5.1.0\”复制了 schema.xml 文件服务器\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,并尝试在管理 UI 的“架构浏览器”中查看新字段,但这些字段不存在。请帮助我解释字段未显示的原因?

【问题讨论】:

标签: tomcat solr lucene


【解决方案1】:

在核心目录中的 conf 文件夹中的 solrconfig.xml 文件中。有一种方法可以为该核心使用托管模式或 schema.xml 来定义

要使用 schema.xml,它表示将 &lt;schemaFactory&gt; 设置为...

<schemaFactory class="ClassicIndexSchemaFactory"/>

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

<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

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-08-15
    • 2016-02-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-01-09
    • 2013-08-11
    相关资源
    最近更新 更多