【问题标题】:Error while running query on solr slave在 solr slave 上运行查询时出错
【发布时间】:2017-05-08 21:52:52
【问题描述】:

拥有主从架构后,我尝试在从属设备上运行查询:http://slave.domain/solr/core_name/select?q=some:query&wt=json&indent=true

但它返回一个错误“未定义的字段”。

在 master 上,查询运行良好!

【问题讨论】:

    标签: search solr master slave


    【解决方案1】:

    我注意到我在“solrconfig”文件中的 SchemaFactory 配置错误。奴隶有:

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

    但需要和主配置一样(我的情况是下面的配置):

    <schemaFactory class="ClassicIndexSchemaFactory"/>
    

    这就是我修复它的方法。我在网上搜索但没有结果。也许这可以帮助某人。

    【讨论】:

      【解决方案2】:

      我知道这是一篇旧帖子,但我遇到了同样的问题,并找到了解决方案。当架构工厂设置为“ManagedIndexSchemaFactory”时,它使用 Managed-Schema,而不是 schema.xml。如果您查看您的主索引 solrconfig.xml,它将看起来像这样:

              <requestHandler name="/replication" class="solr.ReplicationHandler" >
         <lst name="master">
             <str name="replicateAfter">startup</str>
             <str name="replicateAfter">commit</str>
             <!--If configuration files need to be replicated give the names here, separated by comma -->
             <str name="confFiles">schema.xml,managed-schema,stopwords.txt,elevate.xml</str>
             <str name="maxNumberOfBackups">0</str>
         </lst>
      </requestHandler>
      

      请注意,您需要在“confFiles”设置中包含“managed-schema”。

      设置 ClassicIndexSchemaFactory 将恢复为使用 schmea.xml。

      【讨论】:

        猜你喜欢
        • 2019-01-28
        • 2020-08-21
        • 2013-03-02
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2022-01-16
        • 1970-01-01
        相关资源
        最近更新 更多